How to use html input tag

青灯夜游
Release: 2019-05-26 17:45:28
Original
4312 people have browsed it

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.

How to use html input tag

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>
Copy after login

Output:

How to use html input tag

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template