• nodeValue is a little more confusing to use, but faster than innerHTML
  • innerHTML parses content as HTML and takes longer(output text/html)
  • textContent uses straight text, does not parse HTML, and is faster(output text/plain)
  • innerText takes styles into consideration. It won’t get hidden text for instance.


The Node.textContent property represents the text content of a node and it descendants.


example.textContent ="<a href='...'>textContent</a>"
will output <a href='...'>textContent</a>

Differences from innerText

  • textContent gets the content of all elements, including