概述
元素
<input type="hidden" name="fujian_type" value="abc"/>
<input type="hidden" name="fujian_type" value="cb"/>
<input type="hidden" name="fujian_type" value="zhanshan"/>
<input type="hidden" name="fujian_type" value="lisi"/>
<input type="hidden" name="fujian_type" value="wanwu"/>
var attList = document.getElementsByName("fujian_type");
//遍历取得的元素中的value
for(var i=0;i<attList.length;i++){
alert(attList[i].value);
}
最后
以上就是细腻黑夜为你收集整理的利用document.getElementsByName获取相同名字的元素并取值的全部内容,希望文章能够帮你解决利用document.getElementsByName获取相同名字的元素并取值所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复