0

是否可以在没有 javascript 的情况下将焦点设置在表单中的特定按钮上?

如果没有,怎么可能用js做到这一点?

提前致谢。

4

1 回答 1

0

In HTML5, the tag <button> has the attribute autofocus, which sets the focus to the button when the page loads.

To set the focus to a button via javascript:

document.getElementById("myButton").focus();
于 2013-03-27T14:22:40.023 回答