Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
createTextNode vs textContent vs innerText vs innerHTML (+ version)
(version: 1)
Comparing performance of:
createTextNode vs textContent vs innerText vs innerHTML
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var a = document.createElement('a');
Tests:
createTextNode
a.appendChild(document.createTextNode('text'));
textContent
a.textContent += 'text';
innerText
a.innerText += 'text';
innerHTML
a.innerHTML += 'text';
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
createTextNode
textContent
innerText
innerHTML
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
createTextNode
1947529.8 Ops/sec
textContent
1.7 Ops/sec
innerText
1.4 Ops/sec
innerHTML
0.8 Ops/sec
Related benchmarks:
createTextNode vs textContent vs innerText
createTextNode vs textContent vs innerText vs innerHTML
createTextNode vs innerHTML vs innerText
createTextNode vs textContent vs innerText vs nodeValue
createTextNode vs textContent vs innerText vs append
let createTextNode vs textContent vs innerText vs innerHTML
createTextNode, textContent, innerContent, innerText, innerHTML, nodeValue
createTextNode vs textContent vs innerText vs append vs new Text
createTextNode vs textContent vs innerText vs innerHTML
Comments
Confirm delete:
Do you really want to delete benchmark?