I think you have some knowledge about the automatic focus and placeholder text of HTML5. To use the automatic focus function of HTML5, you only need to add the autofocus attribute in the form field, first, let's take a look at the sample code that uses HTML auto-focus and placeholder text. If you are interested, let's take a look at the sample code that uses HTML auto-focus and placeholder text.
The Code is as follows:
2:
Register an account
Use auto focus
To use the auto-focus function of HTML5, you only need to add the autofocus attribute to the form field.
For example, when the page is loaded, the cursor is automatically directed to the first form field mailbox of the form and the input efficiency is improved.
The Code is as follows:
Mail Box
Note that if multiple autofocus attributes are set on the page, the user's cursor will only be located in the form field with the last autofocus attribute.
Use placeholder text
The most useful of placeholder text is to explain to the user how to enter the form correctly. Enter the prompt. To use placeholder text, you only need to add the placeholder attribute in the input domain.
The following is the input form field using the placeholder attribute.
The Code is as follows:
-
Mail Box
-
User Name
-
Display name
-
Password
-
Confirm Password
The running effect is as follows:
Enable Automatic completion?
The autocomplete attribute is introduced in HTML5. It is used to notify the browser whether to automatically fill in data for the current form field. Some browsers will remember the data that users have previously entered. In some cases, we may not want users to use record data, especially those similar to passwords.
Turn off auto-completion
The Code is as follows:
You only need to set the atuocomplete value to off to Prevent Automatic completion.