当前位置: 代码迷 >> JavaScript >> 【转】js统制disabled
  详细解决方案

【转】js统制disabled

热度:84   发布时间:2012-10-07 17:28:51.0
【转】js控制disabled

实例1:

[code]<input id="mytext" type="text" value="我是不能用的">
<input type="button" value="disabled" onClick="javascript: document.all.mytext.disabled='false'">
<input type="button" value="enable" onClick="javascript: document.all.mytext.removeAttribute('disabled')">[/code]

?

实例2:

?[code] <input id="mytext" type="text" value="我是能用的">
<input type="button" value="disable" onClick="if (mytext.disabled==false){ mytext.disabled=true;mytext.value='我是不能用的';this.value='enable'} else { mytext.disabled=false;mytext.value='我是能用的';this.value='disable'}"> [/code]

?

来源:原创
版权声明:版权所有,转载时必须以链接形式注明作者和原始出处及本声明。
原创作者:lao8
本文链接地址:http://www.lao8.org/html/8/2010-3-17/201031724952.html
文章名:js控制disabled
本文来自: 老吧网(www.lao8.org) 详细出处参考:http://www.lao8.org/html/8/2010-3-17/201031724952.html

  相关解决方案