HTML forms and input

HTML Forms and Input

HTML forms are used to collect different types of user input.

HTML Form

A form is an area that contains form elements.

Form elements allow users to enter content in the form, such as text areas, drop-down lists, radio-buttons, checkboxes, etc.

The form uses the form tag

to set up:

< input type="">

HTML form-input element

Form tags used in most cases is the input tag ().

The input type is defined by the type attribute (type). The most commonly used input types are as follows:

Text Fields

Text fields are represented by the tag Setting, when the user wants to type letters, numbers, etc. in the form, the text field will be used.

姓名:
年龄:

Note: The form itself is not visible. Also, in most browsers, the default width of a text field is 20 characters.

The password field is defined by the tag :

密码:

Note: Password field characters will not be displayed in plain text, but will be replaced by asterisks or dots.

Radio Buttons

 标签定义了表单单选框选项 

Checkboxes

defines a checkbox. The user needs to select one or several options from a number of given choices.

我喜欢玩LOL
我喜欢玩CF

Submit Button

defines the submit button.

When the user clicks the confirm button, the content of the form will be transferred to another file. The form's action attribute defines the file name of the destination file. The file defined by the action attribute usually performs related processing on the input data received. :

用户名: 密码:

Put the above content together:

     
姓名:

性别:

年龄:





我的爱好:

LOL

CF

DOTA

我的家乡:

用户名:

密 码:


Continuing Learning
||
姓名:

性别:

年龄:





我的爱好:

LOL

CF

DOTA

我的家乡:

用户名:

密 码:

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!