这是我简单的代码,但它似乎不工作。 我已经阅读了很多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