jquery element in dom (v48)

Revision 48 of this benchmark created on


Preparation HTML

<div id="element"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

Setup

var el = $("#element");

Test runner

Ready to run.

Testing in
TestOps/sec
selector
el.closest("html");
ready
object
el.closest(document.documentElement);
ready
using parent
(el.parents('html').length > 0)
ready
using parent with object
(el.parents(document.documentElement).length > 0)
ready

Revisions

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