If you select an element in jQuery by ID is there still a speed improvement by giving it a parent to
- by user169867
Imagine this simplified markup:
<div id="header">
<!-- Other things.... -->
<div id="detail">
</div>
</div>
and assume you already have this code:
var $hdr = $("#header");
Is there any speed difference for jQuery to lookup "detail" this way:
var $detail = $("#detail", $hdr);
vs
var $detail = $("#detail");
Since detail is being looked up by ID?