开发者

not set focus on element

开发者 https://www.devze.com 2023-02-11 22:35 出处:网络
If to log out and press F5 several times focus don\'t set. <script type=\"text/javascript\"> $(document).ready(function() {

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

精彩评论

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