HTML Form November 16, 2015 Learn HTML notes

Source: Internet
Author: User
Tags html form html notes

1.HTML forms for collecting different types of user input

2. Text fields: Users can write information in a text field

3. Password field: Create an HTML password field

4. Form: A region that contains form elements

A form is a region that contains form elements.

Form elements are elements that allow users to enter information in a table consignments (such as a text field, drop-down list, radio box, check box, and so on).

The form is defined using the form label (<form>).

<form>,  ..... INPUT element ...</form>
5. Enter
In most cases, the form label used is the input label (<input>). The input type is defined by the type attribute. Most of the input types that are often used are as follows:
6. Text field:

A text field is used when a user wants to type something like letters, numbers, and so on in a form.

<input type="text" name="firstname" /><input type="text" name="lastname" /></form>

The browser appears as follows:

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

7. Radio button

A radio box is used when a user chooses one of several given choices.

<form> <input type="radio" name="sex" value="male" /> male<br/> <input type="radio" name="sex" value="female" /> female</form>

The browser appears as follows:

Note that you can only select one of these.

8. check box

The check box is used when the user needs to select one or several options from several given selections.

<form> <input type="checkbox" name="bike" /> i has a bike<br/> <input type="checkbox" name="car" /> I have a car</form>

The browser appears as follows:

HTML Form November 16, 2015 Learn HTML notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.