Today I learned that there is a standard-DOM alternative to the convenient IEism
element.innerText (a close relative of
It is slightly different, according to MDN:
.innerText returns the visible text (omitting scripts and CSS-hidden text), whereas
.textContent returns everything, more like walking the document tree.
(This information crossed my awareness while working on Caja, but I didn't recognize it as something I could actually make use of until now.)