Test name | Executions per second |
---|---|
innerText | 3276079.0 Ops/sec |
innerHtml | 1529765.0 Ops/sec |
textContent | 11944145.0 Ops/sec |
<div id='hello'>Hello, World!</div>
var el = document.getElementById('hello');
el.innerText = "Goodbye, cruel world!"
el.innerHTML = "Goodbye, cruel world!"
el.textContent = "Goodbye, cruel world!"