开发者

not set focus on element

If to log out and press F5 several times focus don't set.

<script type="text/javascript">
        $(document).ready(function() {
            setTimeout(function() {
                var logonField = document.getElementById('UserName');

                if (logonField) {
                    logonField.focus();
                    logonField.click();
                }
            }, 200);
        });
    </script>
<%= Html.TextBoxFor(m => m.UserName, new { @class = "logonF开发者_高级运维ield", style = "width:100px;"})%><br/>
            <%= Html.ValidationMessageFor(m => m.UserName) %>


you can user simple Java script which will call on

on load event of html body.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜