What is HTML5 input number? HTML5 input type details (in-context image)

Source: Internet
Author: User
What is HTML5 input number? A detailed description of the HTML5 input type. This article explains in detail what HTML5 input number is, how it is used, and a description of some of the introduction and property values of HTML5 input type.

What type of input does the HTML5 input type have:

This chapter provides a comprehensive overview of these new input types:

    • Email

    • Url

    • Number

    • Range

    • Date pickers (date, month, week, Time, DateTime, datetime-local)

    • Search

    • Color

HTML5 input Type-number:

The number type is used for input fields that should contain numeric values.

HTML5 the new number input type will call up the numeric keypad when the input box has the focus, increasing the effect of the experience. However, on some Android machines, you can switch the word input, and users will accidentally enter non-numeric characters such as "+" and "-". After testing, the number type automatically ignores alphabetic characters and other non-numeric characters, except for "+" "-" ". These two characters can be entered, because these two are symbols of positive and negative numbers and decimal points.

The number type also has a point where the value of the corresponding DOM element is null ("") if the content in the input box is not a pure number (positive, negative), and the content contains some characters.

You can also set a limit on the number of accepted numbers:

Instance:

Points: <input type= "number" name= "Points" min= "1" max= "ten"/>

Use the following properties to specify the qualification for numeric types:

Tip: The Safari browser in the IPhone supports the number input type and works with it by changing the touch-screen keyboard (displaying numbers).

HTML 5 <input> type (style) properties:

Here is an example:

Forms with different input types:

<form action= "demo_form.asp" method= "get" > First  Name: <input type= "text" name= "fname"/><br/>< C2/>last Name: <input type= "text" name= "lname"/><br/> <input  type= "Submit" value= "Submit"/> </form>

Definition and Usage:

The type attribute specifies the types of input elements.

Note: This property is not required, but we think you should always use it.

Grammar:

<input type= "Value" >

Property value:

"Recommended"

What are the new structural elements of HTML5? HTML5 the use of new structural elements (recommended)

What does the lang attribute in the

HTML do? What is the effect of the lang attribute in HTML?

Related Article

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.