Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
JQuery: text vs html
compare speed for adding text to element
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/119.0.0.0 Safari/537.36
Browser:
Chrome 119
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
text
1.4M/s
html
893K/s
View exact numbers
Test name
Executions per second
✓
text
1,355,605 Ops/sec
html
893,217 Ops/sec
HTML Preparation code:
<span id="text"></span> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.js'></script>
Script Preparation code:
var $element = $("#text");
Tests:
html
$element.html("hello");
text
$element.text("hello");