The
tag is used to specify an input field in which the user can enter data. Input fields can take many forms depending on the value of the type attribute. Input fields can be text fields, checkboxes, masked text controls, radio buttons, buttons, etc.
html How to use the input tag?
Function: is used to specify the input fields in which users can enter data.
Description:
According to different type attribute values, the input field has many forms. Input fields can be text fields, checkboxes, masked text controls, radio buttons, buttons, etc.
Note:
In HTML, the tag does not have a closing tag. In XHTML, the tag must be closed properly. The element is empty, it only contains the label attribute.
Differences between HTML 4.01 and HTML5
In HTML 4.01, "align" data is no longer used. This attribute is not supported in HTML5. You can use CSS to define the alignment of the element.
In HTML5, adds several attributes and adds corresponding values.
Differences between HTML and XHTML
In HTML, the tag does not have a closing tag.
In XHTML, the tag must be closed properly.
html input tag Example 1
<!DOCTYPE html> <html> <body> <form action="#"> 文本框:<br> <input type="text"> <br> 密码:<br> <input type="password"> <br> 单选框:<br> <input type="radio"> <br> 提交按钮:<br> <input type="submit"> <br> </form> </body> </html>
Output:
The above is the detailed content of How to use html input tag. For more information, please follow other related articles on the PHP Chinese website!