Say I'm selecting a DOM element using CSS or jQuery, is it faster to provide a higher resolution?
That is, I'm trying to figure out which one of the following jquery selector methods is the best in terms of speed:
Method 1. $("#name")
Method 2. $("input#name")
Method 3. $("div input#name")
Or these CSS selectors:
Method 1. #name {font-weight: bold;}
Method 2. input#name {font-weight: bold;}
Method 3. div input#name {font-weight: bold;}
It seem like Method 3
might make the selector's job easy since it can narrow down to the element faster?