textContent vs createTextNode() vs innerHTML (v17)

Revision 17 of this benchmark created on


Preparation HTML

<div id="div">
</div>

Setup

var div = document.getElementById('div');

Teardown


    document.getElementById('div').innerHTML = '';
  

Test runner

Ready to run.

Testing in
TestOps/sec
innerText
div.innerText = '1234';
ready
createTextNode()
div.appendChild(document.createTextNode('1234'));
ready
innerHTML
div.innerHTML = '1234';
ready
textContent
div.textContent = '1234';
ready
innerOlolo
div.innerOlolo = '1234';
ready
nodeValue
div.nodeValue = '1234';
ready

Revisions

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