请问如何用JS获取所有LI中第三个<SPAN>里隐藏内容的循环处理

<script src="
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
" type="text/javascript"></script>
<DIV class="time_lbc">
<UL id=index_tab01>
<LI onMouseOver="this.className='b'" onMouseOut="this.className=''">
<span class="cx">XX</span>
<SPAN class="xm">XX</SPAN>
<SPAN class="jie" style="display:none">20</span>
<SPAN class="list">XX</SPAN>
<SPAN class="address">XX</SPAN>
</LI>
<LI onMouseOver="this.className='b'" onMouseOut="this.className=''">
<span class="cx">XX</span>
<SPAN class="xm">XX</SPAN>
<SPAN class="jie" style="display:none">15</span>
<SPAN class="list">XX</SPAN>
<SPAN class="address">XX</SPAN>
</LI>
<LI onMouseOver="this.className='b'" onMouseOut="this.className=''">
<span class="cx">XX</span>
<SPAN class="xm">XX</SPAN>
<SPAN class="jie" style="display:none">18</span>
<SPAN class="list">XX</SPAN>
<SPAN class="address">XX</SPAN>
</LI>
....N个LI
</UL>
</DIV>
<!-- 查询处理 -->
<script type="text/javascript">
arr=[];
$("#index_tab01>li>span:nth-child(3):hidden").each(function(){
arr.push($(this).text());
});
alert(arr.join("|"));
<script>

请问在查询到所有结果后如何去对比指定的数字,如果大于指定的数字就把LI属性设置为隐藏
字误了,所有隐藏的这个字段是时间段
<SPAN class="jie" style="display:none">18:00</span>
最新回答
心事过重

2024-10-16 08:03:12

能表达清楚点么?
$("#index_tab01>li>span:nth-child(3):hidden").each(function() {
if (parseInt($(this).text()) > 18) {
$(this).hide();
} else {
$(this).show();
}
});
这种效果?