Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
createTextNode vs textContent vs innerText vs innerHTML
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Browser:
Firefox 115
Operating system:
Windows 7
Device Platform:
Desktop
Date tested:
one year ago
textContent
1.2M/s
innerHTML
1.2M/s
createTextNode
805K/s
innerText
757K/s
View exact numbers
Test name
Executions per second
✓
textContent
1,233,474 Ops/sec
innerHTML
1,204,760 Ops/sec
createTextNode
805,028 Ops/sec
innerText
757,091 Ops/sec
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';