在jQuery中使用’this’关键字时,添加基本过滤器的语法是什么.
例如:
$(this):contains('foo')
$(this):visible OR $(this:visible)
在jQuery中使用’this’关键字时,添加基本过滤器的语法是什么.
例如:
$(this):contains('foo')
$(this):visible OR $(this:visible)
$(':visible,any-selector',this)
$(this).find(':visible,any-selector')
如果你想要一个真或假的回报:
if($(this).is(':visible,any-selector')){
alert('this is visible,or matches "any-selector"');
}
else{
alert('this is hidden,or doesn\'t match "any-selector"');
}