1. Use form tags to interact with users
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <title>表单标签</title> 6 </head> 7 <body> 8 <form> 9 <label for="username">用户名:</label> 10 <input type="text" name="username" id="username" value="" /> 11 <label for="pass">密码:</label> 12 <input type="password" name="pass" id="pass" value="" /> 13 <input type="submit" value="确定" name="submit" /> 14 <input type="reset" value="重置" name="reset" /> 15 </form> 16 </body> 17 </html>
How does the website interact with users? The answer is to use HTML form(form). The form can transmit the data entered by the viewer to the server, so that the server-side program can process the data passed by the form.
Grammar:
<form method="传送方式" action="服务器文件">
Explanation:
1.
tags (otherwise the information entered by the user may not be submitted to the server!).2. Method: The difference between post/get. This part is a matter for back-end programmers to consider.
Give it a try: Add code to the