document.getElementsByName() 在IE中的限制
<html>
<body>
<table><tr>
<td width="180" class="blackd" name="DDE_NODAY" id=dde>
· <a class=hcl href='/06/64/article17146406.shtml' target=_blank>今日硬件行情:奔4小幅回落 2G以上CPU渐成主流</a> <span class="treeline">四</span><br>
· <a class=hcl href='/39/57/article17145739.shtml' target=_blank>新品-可变显示器为电视的朗视液晶电视王</a> <span class="treeline">四</span><br>
</td></tr></table>
<script>
_dde_noday = document.getElementsByName("DDE_NODAY");
alert(document.getElementById("dde").tagName);
if(typeof(_dde_noday)!="undefined" && _dde_noday !=null){
alert(_dde_noday.length);
for(_i=0;_i<_dde_noday.length;_i++){
_spans = _dde_noday[_i].getElementsByTagName("SPAN");
alert(_spans.length);
for(_j=0;_j<_spans.length;_j++) _spans[_j].innerHTML="";
}
}
</script>
</body>
</html>