jquery双重循环

1.jquery 解析如下td 里面的值。

<table>
				<tr class="">
					<td class="num">1</td><th title="日期:23:00 - 23:59">23:00 - 23:59</th><td title="浏览量(PV):5,945">5,945</td><td title="访客数(UV):53" class="nbr">53</td>
				</tr>
				<tr class="">
					<td class="num">2</td><th title="日期:22:00 - 22:59">22:00 - 22:59</th><td title="浏览量(PV):6,266">6,266</td><td title="访客数(UV):108" class="nbr">108</td>
				</tr>
				<tr class="">
					<td class="num">3</td><th title="日期:21:00 - 21:59">21:00 - 21:59</th><td title="浏览量(PV):6,816">6,816</td><td title="访客数(UV):121" class="nbr">121</td>
				</tr>

		</table>

 2.双重循环:

 

 

<script type="text/javascript">
	function dodd(){
	var str="";
	$("table tr").each(function(i){
		$("table tr").eq(i).find('td').each(function(j){
			var temp=$("table tr").eq(i).find('td').eq(j).html();
			str=str+temp+":";
		});
			
	});
	alert(str);
	}
</script>

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值