filmov
tv
Mastering DOM Manipulation: innerText vs textContent in JavaScript | #css3 #javascript #webdesign

Показать описание
Difference Between innerText and textContent
1. textContent gets the content of all elements, including script and style elements. In contrast, innerText only shows "human-readable" elements.
2. textContent returns every element in the node. In contrast, innerText is aware of styling and won't return the text of "hidden" elements.
1. textContent gets the content of all elements, including script and style elements. In contrast, innerText only shows "human-readable" elements.
2. textContent returns every element in the node. In contrast, innerText is aware of styling and won't return the text of "hidden" elements.