jquery设置表单元素为不可用的简单代码
本章节通过简单的实例代码介绍一下如何将表单元素设置为不可用状态。
代码实例如下:
<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8">
<metaname="author"content="https://www.nhooo.com/"/>
<title>毛票票</title>
<scripttype="text/javascript"src="mytest/jQuery/jquery-1.8.3.js"></script>
<scripttype="text/javascript">
$(function(){
$("#webname").prop("disabled","disabled");
$("#bt").prop("disabled","disabled");
})
</script>
</head>
<body>
网站名称:<inputtype="text"id="webname"/><br/>
毛票票<inputtype="button"value="查看效果"id="bt"/>
</body>
</html>
以上这篇jquery设置表单元素为不可用的简单代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。