I'm trying to get an element's innerText
but Chrome returns an empty string because my element is hidden.
Firefox does not.
Is there a way to retrieve the innerText
in Chrome even if the element is invisible?
console.log(document.querySelector('div').innerText + ':' + document.querySelector('div').innerHTML);
div {
height: 0;
overflow: hidden;
}
<div>
Hello, I'm <strong>empty!</strong>
</div>
Honestly I'm really surprised Chrome behaves like this, is it a bug?