I know can I select an element this way:
$("ul.topnav > li.target").css("border", "3px double red");
but how can I do something like:
$(this > li.target).css("border", "3px double red");
$( this ).find( 'li.target' ).css("border", "3px double red");
or
$( this ).children( 'li.target' ).css("border", "3px double red");
Use children for immediate descendants, or find for deeper elements.
children
find
1.4m articles
1.4m replys
5 comments
57.0k users