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.
精彩评论