开发者

Focus textbox onload with mvc?

I have a login-page and would like the "User开发者_开发技巧name" textbox focus when page loads.

How is that done best using MVC? Some script or jquery or something?

/M


<body onload="document.getElementById('myTextBox').focus();">

or in jquery

$(function() { $('#myTextbox').focus(); });


via Jquery

$(function() {
  $("#Username").focus();
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜