SyntaxFix
Write A Post
Hire A Developer
Questions
you can use .is():
.is()
$( "ul" ).click(function( event ) { var target = $( event.target ); if ( target.is( "li" ) ) { target.css( "background-color", "red" ); } });
see source