Autofocus doesn't work on Firefox and doesn't work when coming from another page
问题 I'm creating my page using Javascript. It is a login page and I need to use autofocus on username input text. This operation works on IE and Chrome, but doesn't on Mozilla! This is the HTML I have been adding using JS: '<input id="username" class="loginInput" data-bind="value: userName, valueUpdate: \'afterkeydown\'" type="text" name="User" autofocus><!--User Input text end /-->' When i load the page with Mozilla this input is set this way: <input id="username" class="loginInput" type="text"