那应该如何改呢?
我的理解是return那里只是一个条件语句,如果返回是true,那么这个element就会被filter过滤出来。
For each element, if the function returns true (or a "truthy" value), the element will be included in the filtered set; otherwise, it will be excluded.
另外,下面给出的例子中,“length”出来的也是数字呀。
http://api.jquery.com/filter/#filter-selector
$( "li" )
.filter(function( index ) {
return $( "strong", this ).length === 1;
})
.css( "background-color", "red" );
【 在 Balancer 的大作中提到: 】
: jquery是操作dom节点的,你让他对一个字符串执行css,能有什么效果
:
--
FROM 114.165.107.*