innerHTML vs textContent

Benchmark created on


Preparation HTML

<p id="para"></p>

Test runner

Ready to run.

Testing in
TestOps/sec
With innerHTML
document.getElementById('para').innerHTML = 'Hello world';
ready
With textContent
document.getElementById('para').textContent = 'Hello world';
ready

Revisions

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