Is input a paired tag in HTML5?
The input in HTML5 is not a paired tag, it is a single tag with only a start tag and no end tag; the input tag is used to specify the input field where the user can enter data, the syntax "", according to different type attribute values, the input field has various forms.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
In HTML, tags are keywords surrounded by angle brackets, usually appearing in pairs such as <div> and <code>
There are also tags presented separately, such as: <img src="/static/imghw/default1.png" data-src="1.jpg" class="lazy" alt="Is input a paired tag in HTML5?" >
, etc. This type of tag is called "single tag".
So are input tags in pairs in HTML5?
Input is not a paired tag, but a single tag, with only a start tag and no end tag.
Syntax:
<input type="类型值" />
According to different type attributes, input fields have multiple forms. Input fields can be text fields, checkboxes, password fields, radio buttons, buttons, etc.
Type attribute value | Description |
---|---|
button | Define the clickable button (Often used with JavaScript to launch a script). |
checkbox | Define the checkbox. |
color | Define the color picker. |
date | Define date control (including year, month, day, excluding time). |
datetime | Define date and time controls (including year, month, day, hour, minute, second, fraction of a second, based on UTC time zone). |
datetime-local | Define date and time controls (including year, month, day, hour, minute, second, fraction of a second, without time zone) . |
Defines the fields used for e-mail addresses. | |
file | Define the file selection field and "Browse..." button for file upload. |
hidden | Define hidden input fields. |
image | Define the image as the submit button. |
month | Define month and year controls (without time zone). |
number | Defines the field for entering numbers. |
password | Define the password field (characters in the field will be masked). |
radio | Define radio buttons. |
#range | Defines a control for entering numbers where the exact value is not important (such as a slider control). |
reset | Define the reset button (reset all form values to default values). |
search | Define the text field used to enter the search string. |
submit | Define the submit button. |
tel | Defines the field for entering a phone number. |
text | Default. Defines a single-line text field (default width is 20 characters). |
time | Defines a control for entering time (without time zone). |
url | Defines the field for entering the URL. |
week | Define week and year controls (without time zone). |
Example:
<input type="button" value="点我">
<input type="checkbox" name="vehicle[]" value="Bike"> 我有一辆自行车<br> <input type="checkbox" name="vehicle[]" value="Car"> 我有一辆小轿车<br> <input type="checkbox" name="vehicle[]" value="Boat"> 我有一艘船<br>
选择你喜欢的颜色: <input type="color" name="favcolor"><br>
生日 (日期和时间): <input type="datetime" name="bdaytime">
Related recommendations: "html video tutorial"
The above is the detailed content of Is input a paired tag in HTML5?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
