用js一次改變多個input的readonly屬性值的方法
更新時間:2014年06月11日 08:54:55 作者:
這篇文章主要介紹了用js一次改變多個input的readonly屬性值的方法,需要的朋友可以參考下
復制代碼 代碼如下:
<script>
function doclick1(){
var txtN = document.getElementsByTagName("input");
for(i=0;i<txtN.length;i++){
if(txtN[i].type="text"){
txtN[i].readOnly=false;
}
}
}
</script>
<input type="text" id="contactus1" readonly>
<input type="text" id="contactus2" readonly>
<input type="text" id="contactus3" readonly>
<input type="button" name="button4" value="修改" onclick="doclick1();" />
相關文章
Firefox/Chrome/Safari的中可直接使用$/$$函數進行調試
偶然發(fā)現(xiàn)的,頁面中沒有引入Prototype和jQuery。控制臺中敲$卻發(fā)現(xiàn)是一個函數。又試著敲$$,也是個function2012-02-02