日期:2014-05-16 浏览次数:20342 次
<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">XX</span>
<SPAN class="list">XX</SPAN>
<SPAN class="address">XX</SPAN>
</LI>
<LI onMouseOver="this.className='b'" onMouseOut="this.className=''">
......
</LI>
....N个LI
</UL>
</DIV>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function(){
$("#abv").click(function(){
$("span:hidden").each(function(){
alert($(this).text());
});
});
})
</script>
<input type="button" id="abv" value="测试用按钮"/>
<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">XX1</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">XX2</span>
<span class="list">XX</span>
<span class="address">XX</span>
</li>
</ul>
</div>
var liUnion=document.getElementsByTags('li');
for(var i=0;i<liUnion.length;i++){
var spanThird=liUnion[i].getElementsByTags('span')[2];
//do something
}
<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">X</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">XX</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>
<SPA