insertAdjacentHTML-vs-innerHTML

Benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
insertAdjacentHTML
document.getElementById("counter").insertAdjacentHTML('beforeend', '<span></span>');
ready
innerHTML
var elem = document.getElementById("counter");
elem.innerHTML = elem.innerHTML + '<span></span>';
ready

Revisions

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