When the client finishes loading the page, positioning the cursor on the form's first form field can increase the speed at which the user enters data. Many search engines do this through JavaScript, and now HTML provides auto-focus and treats it as part of the language.
To use the auto-focus feature of HTML, you can simply add the autofocus attribute to any form field.
The browser navigates the user cursor to the last form field that has the autofocus property set.
Fallback
Only a small amount of JavaScript code is required to detect the presence of the autofocus attribute if the user's browser does not support
Autofocus property, you can use Jquerv to accomplish element focus. This is perhaps the simplest alternative you can offer.
After inserting this JavaScript code in the page, you can use the Autofocus property at any time without worrying about browser compatibility issues.
When page loading is complete, the autofocus property can slightly simplify the process by which a user begins filling out a form. Now, you might also want to provide some type-related information on the form field, such as what type of value you want the user to enter. No problem, the next placeholder attribute just solves the problem.
This article is provided by Www.sxt.cn Academy Online learning Platform, reproduced please indicate the source.
Web Development Example Tutorial: Using the Placeholder property to prompt