jquery element in dom (v10)

Revision 10 of this benchmark created by Marek on


Preparation HTML

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

Setup

var el = $("#element");
    var cl = $(".uid_1234");

Test runner

Ready to run.

Testing in
TestOps/sec
offser:visible
el[0].offsetWidth !== 0 || el[0].offsetHeight !== 0;
ready
object
el.closest(document.documentElement);
ready
visible
el.is(":visible");
ready
closest html
el.closest("html");
ready
jqConains
jQuery.contains(document.documentElement, el[0])
ready

Revisions

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