這是我簡單的代碼,但它似乎不工作。 我已經閱讀了很多Q & A的,但我不知道我做錯了什麼?jQuery`.focus()`不工作
<!DOCTYPE html>
<head>
<title>Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
function focus(){
$("#input").focus();
}
</script>
</head>
<body>
<button onClick="focus();">button</button>
<input id="input">
</body>
</html>
我確定有一些我失蹤,但我不知道它是什麼,我想在這方面提供任何幫助。
謝謝。
哇!謝謝!!! – nathan