$( "ul" ).click(function( event ) {
var target = $( event.target );

if ( target.is( "li" ) ) {
    target.css( "background-color", "red" );
  }
});



2. 不能用来判断元素是否hover
Error: Syntax error, unrecognized expression: unsupported pseudo: hover

hover:是mouseenter、mouseover、mouseleave事件的组合


1.is()状态测试

2019-02-17 16:05:17 0 12
这里是评论

相关推荐