innerHTML vs innerText vs nodeValue vs textContent (v49)

Revision 49 of this benchmark created on


Preparation HTML

<div id="content">hello world</div>

Setup

var el = document.getElementById('content');
  var s;

Test runner

Ready to run.

Testing in
TestOps/sec
innerText - div
s = el.innerText;
ready
innerHTML - div
s = el.innerHTML;
ready
textContent - div
s = el.textContent;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.