87,955
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
<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'/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script>
function test() {
alert(document.getElementsByName("setpImg").length);//reslut:5
var hh = document.getElementsByName("setpImg");
alert(hh.length); //reslut:5
var hhh = document.getElementsByName("setBr");
alert(hhh.length); //reslut:5
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<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'/>
<input id="btntets" onclick="test();" type="button" value="testt"/>
</div>
</form>
</body>
</html>