記錄一下用法
用法的關鍵就是 attr 和 disabled 而以 ^^
<html>
<head>
<title>JQuery control the text button </title>
<script src="jquery.js" type="text/javascript"></script>
<script>
function dis()
{
$("#text1").attr("disabled",true); //disabled text button
}
function free()
{
$("#text1").attr("disabled",false); //free text button
$("#text1").focus();
}
</script>
</head>
<body>
<div id="div_id"></divs>
<input type="text" id="text1" name="text1"> <br>
<input type="button" value="Disabled The Button" id="but1" onclick="dis()">
<input type="button" value="Free The Button" id="but2" onclick="free()">
</body>
</html>
全站熱搜
留言列表