开发者

How to set focus on form with more of one button?

I have two buttons for the same form. In the HTML code I declared f开发者_如何学Pythonirst the "Button One" and after the "Button Two".

When I display the form, the focus is on the "Button One", but I would like to have it on the other one without change them the screen position.

What I can do?


$(document).ready(function() {
  $("#Button Two").focus();
});


Set tabindex to the second button less than the first one.

EDIT

yes, you can use javascript, document.getElementById("button2").focus();. Make sure you add this code on page load.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜