Definition and usage
tag is used to collect user information.
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.
Example
A simple HTML form, including two text input boxes and a submit button:
<form action="form_action.asp" method="get"> First name: <input type="text" name="fname" /> Last name: <input type="text" name="lname" /> <input type="submit" value="Submit" /></form>
HTML Differences from XHTML
In HTML, the tag does not have a closing tag.
In XHTML, the tag must be closed properly
Global attributes
The tag supports globals in HTML Attributes.
Event Attributes
The tag supports event attributes in HTML.
The above is the detailed content of How to use html tag. For more information, please follow other related articles on the PHP Chinese website!