html5The tag defining the form is "
". A form can contain one or more form elements, such as input, select, and textarea.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
html5The tag defining the form is "
The form tag is used to create an HTML form (form field) for user input to realize the collection and delivery of user information. form All content in will be submitted to the server.
The form form field can contain various interactive controls - control labels (text fields, check boxes, radio boxes, submit buttons, etc.), such as , , < ; select>, and other tags.
<form action="提交地址" method="提交方式" name="表单名称"> 各种表单控件 </form>
Four commonly used method submission methods:
get 一般用来查询信息 post 一般用来新增信息 put 一般用来修改信息 delete 一般用来删除信息
<input />
The tag is Single tagtype="text" is a normal input box and value is the value inside. Name and id will be used when writing js.
<form action="url地址" method="提交方式" name="表单名称"> <input type="text" name="" id="" value="你好"> </form>
Some attributes of the input tag:
The checked attribute is only available for radio buttons and check boxes
Attribute | Attribute value | Description |
---|---|---|
Text | Single line text input box | |
Password input box | ||
Radio Button | ||
##Checkbox | Checkbox | |
Button | Normal button | |
Submit | Submit button | |
Reset | Reset button | |
Image | Submit button in image form | |
##File | Text fieldname | |
The name of the space | value | |
Default text value in the input control | size | |
The input control is in Display width in the page | checked | |
Define the default selected items in the selection space | Maxlength | |
The maximum number of characters allowed to be entered by the control |
<input type="password" name="" id="" value="">
Radio button box
男 <input type="radio" name="gender" id="" value=""> 女 <input type="radio" name="gender" id="" value="">
Check box
爱好: <br> 抽烟<input type="checkbox" name="hobby" id="" value=""> 喝酒<input type="checkbox" name="hobby" id="" value=""> 烫头<input type="checkbox" name="hobby" id="" value="">
Button
<form action="url地址" method="提交方式" name="表单名称"> <input type="button" name="" id="" value="我是一个普通按钮"> <input type="submit" name="" id="" value="我是一个提交按钮"> <input type="reset" name="" id="" value="我是一个重置按钮"> </form>
##Drop-down box label
<select name="省市区" id=""> <option value="">山东</option> <option value="">北京</option> <option value="">江苏</option> <option value="">深圳</option> <option value="">上海</option> </select>
##Related recommendations: "
》
The above is the detailed content of What is the tag that defines the form in html5. For more information, please follow other related articles on the PHP Chinese website!