Custom DOM Property

Benchmark created on


Preparation HTML

<div id="test">TEST DIV</div>

Setup

const e = document.getElementById('test');

Test runner

Ready to run.

Testing in
TestOps/sec
custom prop direct
e.myProp = "someValue"
e.innerText = e.myProp
ready
via set/get attribute
e.setAttribute("myProp", "someValue");
e.innerText = e.getAttribute("myProp");
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.