HTML Hypertext Markup Language (ix)-form input type

Source: Internet
Author: User

1, <inpur type= "text";: defines a single line input field for text input;

2, <input tyope= "password";: defines the password field. The characters in the password field are masked (shown as asterisks or solid circles);

3, <input type= "submit" value= "submit";: Define the submit button to submit the form data to the form Handler. If the value attribute is omitted, the button is displayed in Chinese "submit";

4, <input type= "radio";: defines a radio Button.

<form><inputtype= "radio"name= "sex"value= "male"checked>Male<BR/><inputtype= "radio"name= "sex"value= "female">Female<BR/><BR/><inputtype= "submit"></form>

5, <input type= "checkbox";: define check Box.

<form><inputtype= "checkbox"name= "vehicle"value= "Bike">I have a bike<BR/><inputtype= "checkbox"name= "vehicle"value= "Car">I have a car<BR/><BR/><inputtype= "submit"></form>

6, <input type= "button";: define the Button.

<type= "button"  value= "press me!" onclick = "alert (' Hello world! ')" > <  input= "button"  onclick= "alert (' Hello world! ')" > Click me! </ Button >

Feel the difference between the <input> element button property and the <button> Element.

HTML5 adds a number of new input types:

7, <input type= "number";: for input fields that should contain input numeric values. You can limit the number by Property.

<form>Quantity (between 1 and 5):<inputtype= "number"name= "quantity"min= "1"Max= "5"><inputtype= "submit"value= "submit query content"></form>

8, <input type= "date";: for input fields that should contain Dates. You can use min, max, and so on to limit Dates. The date selector appears in the input field, depending on the browser support.

<form>Enter a date before 1980-01-01:<BR/><inputtype= "date"name= "bday"Max= "1979-12-31"><BR/><BR/>Enter a date after 2000-01-01:<BR/><inputtype= "date"name= "bday"min= "2000-01-02"><BR/><BR/><inputtype= "submit"></form>

9, <input type= "color";: for input fields that should contain Colors. Depending on the browser support, the color picker appears in the input field.

< form > Select your favorite color: <  type= "color"  name= "favcolor " value= "#ff0000" > <  type= "submit"></form>

10, <input type= "range";: An input field that should contain values in a Range. Depending on browser support, the input field can be displayed as a slider Control. You can use min,

max, step, Value property to specify the Limit.

<form>Points:<inputtype= "range"name= "points"min= "0"Max= "ten"Step= "5"><inputtype= "submit"></form>

11, <input type= "month";: allows the user to select the month and year. The date selector appears in the input field, depending on the browser support.

< form > Birthday (month and year): <  type= "month"  name= "bdaymonth"><   type= "submit"></form>

12, <input type= "week";: allows users to select weeks and Years. The date selector appears in the input field, depending on the browser.

< form > Select a week: <  type= "week"  name= "year_week"><   type= "submit"></form>

13, <input type= "time";: allows the user to select Times (no time zone). Depending on the browser support, the time picker appears in the input field.

< form > Select a time: <  type= "time"  name= "usr_time"><   type= "submit"></form>

14, <input type= "dtetime";: allows the user to select a date and time (sometimes a zone). The date selector appears in the input field, depending on the browser support.

15, <input type= "datetime-local";: allows the user to select a date and time (no time zone). The date selector appears in the input field, depending on the browser support.

16, <input type= "email";: The input field that should contain the e-mail address.

17, <input type= "search";: used for search fields (the search field behaves like a regular text field).

18, <input type= "tel";: the input field for which the phone number should be Included.

19, <input type= "url": for the input field that should contain the URL address.

HTML Hypertext Markup Language (ix)-form input type

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: info-contact@alibabacloud.com 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.