If you chose li
like this:
$(".prodcat-line")....
Then you can select direct descendants using '>':
$(".prodcat-line>a").... $(".prodcat-line>a.prodcat").... $(".prodcat-line>.prodcat")....
Or using the jQuery children
method:
$(".prodcat-line").children("a")... $(".prodcat-line").children("a.prodcat")... $(".prodcat-line").children(".prodcat")...
Or, from any descendant, omit >
and use just a space:
$(".prodcat-line a").... $(".prodcat-line a.prodcat").... $(".prodcat-line .prodcat")....
Or, again, using the jQuery method, this time find
:
$(".prodcat-line").find("a")... $(".prodcat-line").find("a.prodcat")... $(".prodcat-line").find(".prodcat")...
source share