A simple HTML5 function to be discussed here is to allow the input focus to automatically fall on an element when the page is loaded; this action is completed using the autofocus attribute.
HTML code is very simple:
This property can be very useful in certain situations. For example, Google's homepage is where people use it to search 99% of the time, so once the page is loaded, the cursor must be positioned in the input box. In the past, JavaScript was needed to complete it, but now it is no longer necessary, HTML can complete it by itself.