【发布时间】:2010-04-08 15:28:23
【问题描述】:
给定以下 HTML:
<div class="parent">
<span class="child">10</span>
</div>
<div class="parent">
<span class="child">20</span>
</div>
我想根据它的跨度值(子值)过滤和隐藏父 div,所以想到了做类似的事情:
<script>
$('span.child').filter(function(index) {
return ($(this).text() < '15');
}).$(this).parent().hide();
</script>
没有成功...我没有根据跨度值隐藏父 div..
谁能帮帮我?
非常感谢。
【问题讨论】: