3 ms·
Why does Element.innerText cause the browser to "layout?" The author said he might explain this in another article.
by kevin_rubyhouse 14y ago
Why does Element.innerText cause the browser to "layout?" The author said he might explain this in another article.
- kellegous 14y agoYou are going to make me give away my future punchline. ;-) The short story is that innerText will include the line breaks that are introduced by text layout. A lot of people call innerText when what they actually want is textContent (which doesn't layout because is just a concatenation of the descendent text nodes)