码迷,mamicode.com
首页 > 其他好文 > 详细

disable 与readyOnly

时间:2017-12-29 23:37:11      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:bsp   out   false   meta   公司   text   html   set   单元素   

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>disable</title>
</head>
<script type="text/javascript">
function disableI(bDisable){
document.getElementById("dis").disabled=bDisable;//禁止使用注册按钮
}

window.onload=function(){
document.getElementById("taID").readOnly=true;//文本框只读
disableI(true);
setTimeout("disableI(false)",5000);
}
</script>
<body>
<textarea id="taID" rows="5" cols="300">
注册协议:
1,遵守国家法律
2,不得将其使用为非正当方向
3,我们公司说了算,嘻嘻
</textarea><br />
<p>5秒后可注册</p>
<input type="button" value="注册" id="dis" />
</body>
</html>

 

disable 为true时表示禁止使用表单,readOnly 属性为true 表示当前表单元素为只读,防止用户对内容进行修改

disable 与readyOnly

标签:bsp   out   false   meta   公司   text   html   set   单元素   

原文地址:https://www.cnblogs.com/wxhhts/p/8146440.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!