DEV Community

Discussion on: Re-implementing jQuery methods in the HTMLElement prototype

Collapse
 
jochemstoel profile image
Jochem Stoel

Thanks I fixed the things you said in updated gist. Why does text need to return textContent and not innerText?

Collapse
 
nektro profile image
Meghan (she/her) • Edited

innerText is a lot more performance heavy and triggers layout to be recalculated.
stackoverflow.com/a/35213639/5203655

Thread Thread
 
daniel15 profile image
Daniel Lo Nigro

AFAIK, innerText is also non-standard (originally IE-only) whereas textContent is part of the standard.