标签:asc onload elements ntb name nts i++ span nbsp
onload = function () { alert(document.getElementById(‘Button0‘).value); var buttonArr = document.getElementsByName(‘n1‘); for (var i = 0; i < buttonArr.length; i++) { alert(buttonArr[i].value); } var button = document.getElementsByTagName("input"); for (var i = 0; i < button.length; i++) { alert(button[i].value); } };
获取页面元素三种方式:
getElementById
getElementsByName
getElementsByTagName
标签:asc onload elements ntb name nts i++ span nbsp
原文地址:http://www.cnblogs.com/leimingzhiqiu/p/7017707.html