我发现getElementsByName有些控件不支持,如 ,这是为什么?
document.getElementsByName('setBr').length
document.getElementsByName('setpImg' ).length
<br id='setpBr1' name='setBr'>
<br id='setpBr2' name='setBr'>
<br id='setpBr3' name='setBr'>
<br id='setpBr4' name='setBr'>
<br id='setpBr5' name='setBr'>
<img id='setpImg1' name='setpImg' src='./img/going_down.png' height='59' width='36'/>
<img id='setpImg2' name='setpImg' src='./img/going_down.png' height='59' width='36'/>
<img id='setpImg3' name='setpImg' src='./img/going_down.png' height='59' width='36'/>
<img id='setpImg4' name='setpImg' src='./img/going_down.png' height='59' width='36'/>
<img id='setpImg5' name='setpImg' src='./img/going_down.png' height='59' width='36'/>
相关推荐
Document:getElementsByName()使用方法及示例
Document:getElementsByName()想必大家对它并不陌生吧,主要是根据名称获取元素,下面是其具体的使用方法及范例,感兴趣的朋友不要错过
解决 firefox 不支持 document.all的方法
解决 firefox 不支持 document.all的方法
Javascript访问html页面的控件的方法详细分析第1/2页
下面切入正题: 访问控件的主要对象是:document对象。分别对应当前文档所有的(子对象)个人观点。并且已经提供的几个主要方法来访问对象。 1. document.getElementById 2. document.getElementsByName 3 document.getElementsByTagName 4 document.all 下面我主要谈谈以上几个方法的具体用法: 一.首先我来谈谈document.getElementById的用法。 Var obj=document.getElementById
document.all与getElementById、getElementsByName、getElementsByTagName用法区别-document.all第1/2页
Document.all[]是文档中所有标签组成的一个数组变量,包括了文档对象中所有元素
innerHTML 和 getElementsByName 在IE下面的bug 的解决
比如有这样一个问题。 代码如下: <div id=”playlist”> </div> 在这div 中,加入一个播放吗列表。这列表用innerHTML 加入。 代码如下: var plst = null; plst = player.getPlaylist(); if (plst) { var txt = ”; for(var i in plst) { txt += ‘<a></a><div class=”fv_item” id=”fv_item_’+><div class=”playing_bg” name=”playi


