Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
innerText vs innerHTML vs textContent
(version: 0)
Comparing performance of:
innerText vs innerHTML vs textContent
Created:
2 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div id="A">12345<div>
Script Preparation code:
var X = 0;
Tests:
innerText
A.innerText = ++X;
innerHTML
A.innerHTML = ++X;
textContent
A.textContent = ++X;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
innerText
innerHTML
textContent
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
innerText
1203724.8 Ops/sec
innerHTML
1265011.4 Ops/sec
textContent
431405.5 Ops/sec
Related benchmarks:
createTextNode vs innerHTML vs innerText
innerText vs textContent + trim (HTML)
createTextNode vs textContent vs innerText vs innerHTML (for reading)
textContent vs innerHTML vs innerText
Comments
Confirm delete:
Do you really want to delete benchmark?