开发者

how to set tab focus on li page load using jquery

开发者 https://www.devze.com 2022-12-10 07:42 出处:网络
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&

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

精彩评论

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