用replace<html>
<body>
<table id="tab">
<tr>
<td nowrap width="180px"><span unselectable=on>案发时间<label disabled style="display:none">66</label></span></td>
<td nowrap width="100px"><span unselectable=on>案发地点<label disabled style="display:none">66</label></span></td>
</tr>
</table>
</body>
<script language="javascript">
for(var i=0;i<tab.rows.length;i++){
for(var j=0;j<tab.rows[i].cells.length;j++){
alert(tab.rows[i].cells[j].innerText.replace(/\d/g,''));
}
}
</script>
</html>
<body>
<table id="tab">
<tr>
<td nowrap width="180px"><span unselectable=on>案发时间<label disabled style="display:none">66</label></span></td>
<td nowrap width="100px"><span unselectable=on>案发地点<label disabled style="display:none">66</label></span></td>
</tr>
</table>
</body>
<script language="javascript">
for(var i=0;i<tab.rows.length;i++){
for(var j=0;j<tab.rows[i].cells.length;j++){
alert(tab.rows[i].cells[j].innerText.replace(/\d/g,''));
}
}
</script>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货