To access inner html you need to use below defined code
let myElement = document.getElementById('example'); let contents = myElement.innerHTML; console.log(contents);
It will work for you