jquery element in dom (v78)

Revision 78 of this benchmark created by velocityzen on


Preparation HTML

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

Setup

var $el = $("#element");
    var el = $el[0];

Test runner

Ready to run.

Testing in
TestOps/sec
selector
$el.closest("html");
ready
object
$el.closest(document.documentElement);
ready
jQuery.contains
jQuery.contains(document.documentElement, el)
ready
parents
$el.parents('html').length > 0
ready
parent
$el.parent().length > 0
ready
document
$.contains(document, el)
ready
native
document.body.contains(el)
ready

Revisions

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