Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Check data attribute: hasAttribute vs dataset
Compare hasAttribute to in dataset
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/134.0.6998.99 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 134
Operating system:
iOS 18.3.2
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
hasAttribute
19405950.0 Ops/sec
dataset
9333133.0 Ops/sec
HTML Preparation code:
<div id="foo" data-foo></div>
Script Preparation code:
var element = document.getElementById("foo");
Tests:
hasAttribute
var foo = element.hasAttribute("data-foo");
dataset
var foo = "foo" in element.dataset;