Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Linux
Desktop
5 months ago
Test name Executions per second
innerText 3276079.0 Ops/sec
innerHtml 1529765.0 Ops/sec
textContent 11944145.0 Ops/sec
HTML Preparation code:
x
 
1
2
<div id='hello'>Hello, World!</div>
Script Preparation code:
 
var el = document.getElementById('hello');
Tests:
  • innerText

     
    el.innerText = "Goodbye, cruel world!"
  • innerHtml

     
    el.innerHTML = "Goodbye, cruel world!"
  • textContent

     
    el.textContent = "Goodbye, cruel world!"