". The form tag is used to create an HTML form (form field) for user input to collect and transfer user information. All content in the form will be submitted to the server; the syntax "
form control
". A form can contain one or more form elements, such as input, select, and textarea."/> ". The form tag is used to create an HTML form (form field) for user input to collect and transfer user information. All content in the form will be submitted to the server; the syntax "
form control
". A form can contain one or more form elements, such as input, select, and textarea.">

Home  >  Article  >  Web Front-end  >  What is the tag that defines the form in html5

What is the tag that defines the form in html5

青灯夜游
青灯夜游Original
2022-07-26 16:26:145554browse

html5The tag defining the form is "

". The form tag is used to create an HTML form (form field) for user input to collect and transfer user information. All content in the form will be submitted to the server; the syntax "
form control
". A form can contain one or more form elements, such as input, select, and textarea.

What is the tag that defines the form in html5

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

html5The tag defining the form is "

".

html5 form form

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.

Label syntax format

    <form action="提交地址" method="提交方式" name="表单名称">
        各种表单控件
    </form>

Four commonly used method submission methods:

get    		一般用来查询信息
post		一般用来新增信息
put      	一般用来修改信息
delete		一般用来删除信息

Control label:

input tag

  • The meaning of input is
  • &lt;input&gt;The tag is Single tag
  • The type attribute sets different attribute values ​​to specify different control types
  • In addition to the type attribute, there are other attributes

type="text" is a normal input box and value is the value inside. Name and id will be used when writing js.

    
        &lt;input&gt;     

What is the tag that defines the form in html5

Some attributes of the input tag:

The checked attribute is only available for radio buttons and check boxes

##typeTextSingle line text input boxPasswordPassword input boxRadioRadio ButtonText fieldnamevaluesizecheckedMaxlengthPassword box
Attribute Attribute value Description



##Checkbox
Checkbox

Button
Normal button

Submit
Submit button

Reset
Reset button

Image
Submit button in image form
##File
The name of the space
Default text value in the input control
The input control is in Display width in the page
Define the default selected items in the selection space
The maximum number of characters allowed to be entered by the control

&lt;input&gt;

What is the tag that defines the form in html5Radio button box

Smartly select one radio button box with the same name

        男 &lt;input&gt; 
        女 &lt;input&gt;

What is the tag that defines the form in html5Check box

Multiple check boxes can select multiple

        爱好: 
          抽烟&lt;input&gt;          喝酒&lt;input&gt;          烫头&lt;input&gt;

Button

Ordinary buttons can use js to add functions according to requirements

The submit button will submit the entered form information to the action address of the form

The reset button will reset the form information to the default

    
        &lt;input&gt;         &lt;input&gt;         &lt;input&gt;     

##Drop-down box labelWhat is the tag that defines the form in html5

The drop-down box label is a bit special. It is not an attribute of the input but a separate label

        <select>
            <option>山东</option>
            <option>北京</option>
            <option>江苏</option>
            <option>深圳</option>
            <option>上海</option>
        </select>

##Related recommendations: "

html video tutorial

What is the tag that defines the form in html5

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!

Statement:
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