Right, that’s rather odd.
I gave you an example where it doesn’t work fine. It all depends on the inner HTML of the h1
. If, for example, it contains a link or other things, the HTML will be different from the text. innerText
always does The Right Thing™