in jquery we can find inner class or something else with
$("#id xxxxxx")
xx… can be anything.
But i am taking element by this like below:
$(".something").bind("click",function(){
$(this).find("......
});
and want to take inner element something like : $(this + " .divClassNameOrFilter")
I can take the element with $(this).find(".divClassNameOrFilter)
But after i found something that will be an array and i can’t continue with
$(this).find(".divClassNameOrFilter).css(.....
I have to take the first element with [0] and wrap it again with $(...) like that:
$($(this).find(".divClassNameOrFilter)[0]).css(.....
Is there any way not to do like i said above?
You can use
.eq()like this:Or use
:first, like this:As an aside, there are other filter functions and selectors as well.