标签:
1 function GetElementsByName(tag, name) { 2 var elem = document.getElementsByTagName(tag); 3 var arr = []; 4 var index = 0; 5 var l = elem.length; 6 for(var i = 0; i < l; i++) { 7 var att = elem[i].getAttribute("name"); 8 if(att == name) { 9 arr[index++] = elem[i]; 10 } 11 } 12 return arr; 13 }
标签:
原文地址:http://www.cnblogs.com/sweetyu/p/4941940.html