Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Test content attribute vs html element
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
content attribute
647325.9 Ops/sec
html element
650371.7 Ops/sec
HTML Preparation code:
<div class="js-tooltip" data-tooltip-content="test"></div> <div class="c-tooltip">test</div>
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
content attribute
var tooltip = document.getElementsByClassName("js-tooltip")[0]; console.log(tooltip.nextElementSibling.innerHTML);
html element
var tooltip = document.getElementsByClassName("js-tooltip")[0]; console.log(tooltip.dataset.tooltipContent);