In the example of jQuery's find()
(the doc is at http://api.jquery.com/find/)
I wonder why we need it, because, is
$('li.item-ii').find('li')
the same as
$('li.item-ii li')
essentially, all the <li>
elements inside the <li>
element that has the class item-ii
Similarly
$('#id1').find(".class1 #id2")
is the same as
$('#id1 .class1 #id2")
?
Update: if they are the same, why do we need find() ? is it because mainly when we need to further select some elements when given another element in a variable, so we can do elementFoo.find("...")
?