In this article, there is a part of specificity (Fourth point).
If you have $('#tabContainer li')
, all li
you have in the document wil be queried. Then each of those li
would be checked to see if they have a parent #tabContainer
.
To get it quicker, $('#tabContainer').find('li')
can be used. The li would be searched in the #tabContainer, which is unique in the document.
But apparently, if you are selecting using an ID, there should not be much improvement in performance (from the answer on this question on SO which also talks about specificity).