parent() vs parentNode simple (v2)

Revision 2 of this benchmark created on


Preparation HTML

<div id="outer" class="myClass">
<div id="inner">
</div>
</div>
<div id="other" class="myClass"></div>
<div id="another" class="myClass"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var el = document.getElementById('inner');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
parent()
$(el).parent().hasClass('active');
ready
parentNode
$(el.parentNode).hasClass('active');
ready

Revisions

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