Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Reading textContent vs innerText vs innerHTML
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Browser:
Firefox 147
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
textContent
1.4M/s
innerHTML
1.2M/s
innerText
3K/s
View exact numbers
Test name
Executions per second
✓
textContent
1,394,836 Ops/sec
innerHTML
1,188,129 Ops/sec
innerText
2,988 Ops/sec
HTML Preparation code:
<div id='hello'>Hello, World!</div>
Script Preparation code:
let el = document.querySelector("#hello");
Tests:
textContent
let i = 1000, tmp = ''; while (i--) tmp = el.textContent;
innerText
let i = 1000, tmp = ''; while (i--) tmp = el.innerText;
innerHTML
let i = 1000, tmp = ''; while (i--) tmp = el.innerHTML;