1 Placeholder text positioning
When the user has not entered a value, the input control may display descriptive text or a message to the user via placeholder,
This is common in the current site, some JS framework will provide similar functionality, simply say in the previous version of the common solution, create a label for the input control, and then control the location of the label through the CSS to cover the input control, when the label gets the focus, The browser points the focus to the input control.
With placeholder, this feature is built into the new browser, and its attribute values are displayed in a light gray style in the input box, and the message disappears automatically when the input box has the focus and value.
2 AutoComplete Save input value
The AutoComplete feature is aware of whether the input values should be saved for future use, and AutoComplete should protect user-sensitive data against unsafe storage by local browsers.
On: The field does not need to be protected and values can be saved and restored
Off: The field needs to be protected and the value cannot be saved
Unspecified: Contains default settings, if not included in the form or if no value is specified, behaves as on
3 Autofocus automatically get focus
When the page loads, we use autofocus to specify a form element to get the focus, but only one autofocus per page is allowed, and if more than one is set, it is equivalent to unspecified behavior.
A page can have only one control with that property
From a practical point of view, do not abuse this property casually.
Use the Autofocus property on a page only if it is the primary purpose for which the control is used.
The Autofocus property applies to allThe type of the label.
4 List Attributes and DataList selected values
By using list, developers can construct a list of selected values for an input control, using methods
5 Required cannot be empty
The Required property specifies that the input field must be filled in before submission (cannot be empty). It is the simplest way to form validation
6 Pattern Validation Regular
The Pattern property specifies the mode (pattern) used to validate the input field, which is a regular expression. Those input controls of type e-mail or URL have built-in related regular expressions, and if value does not conform to its regular expression, the form will fail validation and cannot be submitted
New features of the form