I have a search input text which I\'d like to apply a focus() when loading the page, the problem is that the focus function automatically does a sc
As of today, the preferred way to set the focus on an element upon page load is using the autofocus attribute. This does not involve any scrolling.
The autofocus attrubute is part of the HTML5 standard and is supported by all major browsers, with the only notable exception of Internet Explorer 9 or earlier.