1
我有下面的例子:LIVE EXAMPLEjquery返回false - 为什么?
我的语句返回false,为什么呢?
if($('.superstars-table tr').slice(5).is(':hidden') == true){ alert('yes');}
我有下面的例子:LIVE EXAMPLEjquery返回false - 为什么?
我的语句返回false,为什么呢?
if($('.superstars-table tr').slice(5).is(':hidden') == true){ alert('yes');}
因为您的选择器$('.superstars-table tr').slice(5)
不符合任何元素。 slice()
方法是零索引,所以请改为$('.superstars-table tr').slice(4)
。