Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
jquery - empty vs html
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0
Browser:
Firefox 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
innerHtml
30.7M/s
empty
11.4M/s
html
6.4M/s
View exact numbers
Test name
Executions per second
✓
innerHtml
30,699,034 Ops/sec
empty
11,409,897 Ops/sec
html
6,380,758 Ops/sec
HTML Preparation code:
<div id="foo">foo bar foo bar foo bar foo bar</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.js'></script>
Script Preparation code:
var foo = $("#foo");
Tests:
empty
foo.empty();
html
foo.html("");
innerHtml
foo[0].innerHTML = "";