Possible Duplicate:
What does the second argument to $() mean?
There is some time that i use jQuery and from time to time I see this:
$(argument1, argument2).doSomething();
Where is the documentation for filtering with a second argument?
EDIT:
I’m talking about this way of using it:
var t=0; // the height of the highest element (after the function runs)
var t_elem; // the highest element (after the function runs)
$("*",elem).each(function () {
$this = $(this);
if ( $this.outerHeight() > t ) {
t_elem=this;
t=$this.outerHeight();
}
});
Notice:
$("*",elem)
I’m not talking about
$("a,b,span")
way of filtering. I now that well.
It’s the first definition in the
jQuery()documentation:and further down:
However, internally it just calls
.findand you will often find people recommending the usage of.findover passing a second argument.So, your example is equivalent to
$(argument2).find(argument1).doSomething();