getElementById(childNode) vs children

Benchmark created on


Preparation HTML

<div id='a'>
  <div id='b'></div>
</div>

Setup

var a = document.getElementById('a');

Test runner

Ready to run.

Testing in
TestOps/sec
childNode
document.getElementById(a.childNodes[0].id);
ready
children
a.children[0];
ready

Revisions

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