Continuing the discussion from I Made A Chat Website:
I personally like using innerText
, what’s the difference (if any) between textContent
and innerText
?
Continuing the discussion from I Made A Chat Website:
I personally like using innerText
, what’s the difference (if any) between textContent
and innerText
?
innerText
gets the content of all elements whose display
attribute is not set to hidden
.
While textContext
gets the content of all elements, including special elements like <script>
and <style>
.
(Just a by-the-way, I believe you meant display
attribute set to none
.)