New properties and events H5 form

1. Tip placeholder placeholder

<input type="text" name="userName" placeholder="请输入用户名">

2. automatically get focus autofocus

After adding this attribute, the input box will automatically get the focus when the page loads

<input type="text" name="userName" autofocus>

3. AutoComplete autocomplete: on open (default) off close

When you turn on this property, when the input box gets the focus, it will automatically prompt the data submitted.
Note: The data must be submitted successfully, and this input tag must have a name attribute, because it relies on the value of the name attribute to filter the data submitted, the data only when the agreement will be submitted before the name attribute value prompt out.

<div>
    用户名:<input type="text" name="userName" autocomplete="on">
    爱好:<input type="text" name="hobby" autocomplete="on">
</div>

Guess you like

Origin www.cnblogs.com/OrochiZ-/p/11600452.html