Both of these selectors will allow:
$('#foo').show();
however, management says:
For id selectors, jQuery uses the JavaScript function document.getElementById (), which is extremely efficient. When another selector is connected to the id selector, for example h2 # pageTitle, jQuery performs an additional check before identifying the element as a match .
You can think of the above additional verification as completely pointless if you don't have duplicate identifiers in your markup, which is wrong in terms of defining and using the HTML ID attribute. See http://www.w3schools.com/tags/att_standard_id.asp .
karim79
source share