标签:sele nodename highlight length asc class put get set
var allEle = document.getElementsByTagName(‘*‘); console.log(allEle) for(var i=0;i<allEle.length;i++){ if(allEle[i].nodeName=="INPUT"){ // $(allEle[i]).attr("disabled","disabled") //jq 方法 allEle[i].setAttribute(‘disabled‘,‘disabled‘); //js 方法 } if(allEle[i].nodeName=="SELECT"){ allEle[i].setAttribute(‘disabled‘,‘disabled‘); // $(allEle[i]).attr("disabled","disabled") } }
标签:sele nodename highlight length asc class put get set
原文地址:https://www.cnblogs.com/banyuege/p/14441256.html