Home > Article > Web Front-end > The javascript code that makes the first control on the page selected by default_form effects
When a form is displayed on the page, the focus is usually not on the first control. This effect can be achieved with just a little common script.
document.forms[0].elements[0].focus();
If the first control on the page is a hidden field, or does not support focus(), the above javascript may cause an error!