Article introduction of Wulin.com (www.vevb.com): In HTML5, the Web Forms 2.0 standard is absorbed, and the functions for form elements are greatly strengthened, making the development of forms faster and more convenient.
In HTML5, the Web Forms 2.0 standard is absorbed, and the functions for form elements are greatly strengthened, making the development of forms faster and more convenient.
1.form attributeIn HTML5, you can write the form slave element anywhere on the page, and then specify a form attribute to the element, and the attribute value is the id of the form, so that the element can be declared to belong to the specified form.
<form id=test><input type=text></form><textarea form=test></textarea>2.formaction propertyIn HTML5, you can add different formatting attributes to all submit buttons, click different buttons, and submit different forms to different pages.
<input type=submit format=a.php><input type=submit format=b.php>3.fomethod attributeIn HTML5, you can use the formataction attribute to specify a different submission page for each form element, and you can also use the formthod attribute to specify a different submission method for each form element.
<input type=submit format=a.php formmethod=post><input type=submit format=a.php formmethod=get>4.placeholder attributeplaceholder refers to the reduction of the opacity of the text message when the text box is in an uninput state and the cursor focus is not obtained. For example, the effect of this website's network base search box is.
<input type=text placeholder=Click here to search>5.autofocus attributeAutomatically gain cursor focus for the text box, selection box, or button control.
<input type=text autofocus>6.list attributeIn HTML5, add a list attribute to a single line text box, and the value of the attribute is the id of a datalist element. The datalist element is similar to a selection box. The element itself is not displayed, but is displayed in a prompt input when the text box gets focus.
<input type=text list=webjxcom><datalist id=webjxcom style=display:none;> <option>HTML</option> <option>CSS</option> <option>JavaScript</option></datalist>To avoid displaying incorrectly in browsers that do not support this element, set it to not display with CSS, etc.
7.auotcomplete attributeThe automatic completion function used for auxiliary input saves input time and is also a very convenient function. For the auotcomplete attribute, you can specify three values: on, off, and (not specify).
<input type=text autocomplete=on list=webjxcom>