我是新的jQuery,玩弄它.当我点击按钮时我想要文本框但是它不能以这种方式工作.
<input type=text id=txt></input>
<input type=button id=btn value="Click Me"></input>
$document.ready(function() {
$("input#btn").click(function() {
$("input#txt").hide();
});
});
Run Code Online (Sandbox Code Playgroud)
$(document).ready(function(){
$("input#btn").click(function(){
$("input#txt").hide();
});
});
Run Code Online (Sandbox Code Playgroud)
错过了()周围document你可以使用捷径也喜欢
$(function(){
//your code here
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
29386 次 |
| 最近记录: |