The new elements in the html5 form are: 1. The "
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
New elements in html5 form
Tag | Description |
---|---|
Define the predefined options of the input control. | |
Define key pair generator fields (for use with forms). | |
Define the calculation result. |
1.
The
Please use the list attribute of the element to bind the
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <form action="#" method="get"> <input list="browsers" name="browser"> <datalist id="browsers"> <option value="Internet Explorer"> <option value="Firefox"> <option value="Chrome"> <option value="Opera"> <option value="Safari"> </datalist> <input type="submit"> </form> </body> </html>
2,
When the form is submitted, the private key is stored locally and the public key is sent to the server.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <form action="demo_keygen.php" method="get"> 用户名: <input type="text" name="usr_name"> 加密: <keygen name="security"> <input type="submit"> </form> </body> </html>
3.
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" id="a" value="50">100 +<input type="number" id="b" value="50"> =<output name="x" for="a b"></output> </form>
Related recommendations: "html video tutorial"
The above is the detailed content of What are the new elements in html5 forms?. For more information, please follow other related articles on the PHP Chinese website!