开发者

how to set tab focus on li page load using jquery

I have below code in html.

<li class="selected" runat="server" id="lihome"><a href="/ISS/home.aspx" title="Home"><span>Home</span></a>开发者_如何学运维</li>

Now I want to start my tabbing from this li when my page get loaded. Please suggest how to do this.

Thanks.

Best Regards,

MS


You should focus the anchor element inside the "selected" LI, since only form elements, anchors and iframes are focusable:

$(function () { 
  $('li.selected a').focus(); 
});


$(function () { 
  $('#lihome a').focus(); 
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜