not set focus on element
<p>If to log out and press F5 several times focus don't set.</p>

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

                if (logonField) {
                    logonField.focus();
                    logonField.click();
                }
            }, 200);
        });
    &lt;/script&gt;
&lt;%= Html.TextBoxFor(m =&gt; m.UserName, new { @class = "logonField", style = "width:100px;"})%&gt;&lt;br/&gt;
            &lt;%= Html.ValidationMessageFor(m =&gt; m.UserName) %&gt;
</code></pre>
