Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
innerHTML vs innerText vs textContent1231232
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
innerHtml
1.7M/s
textContent
689K/s
innerText
166K/s
View exact numbers
Test name
Executions per second
✓
innerHtml
1,736,083 Ops/sec
textContent
689,266 Ops/sec
innerText
165,630 Ops/sec
HTML Preparation code:
<span id='hello'>Hello, World!</span>
Tests:
textContent
let i = 10; let el = document.querySelector("#hello"); while (i--) { el.textContent = "Goodbye"; }
innerHtml
let i = 10; let el = document.querySelector("#hello"); while (i--) { el.innerHtml = "Goodbye"; }
innerText
let i = 10; let el = document.querySelector("#hello"); while (i--) { el.innerText = "Goodbye"; }