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:
one year ago
Test name
Executions per second
empty
11409897.0 Ops/sec
html
6380758.5 Ops/sec
innerHtml
30699034.0 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 = "";