HTML5 has a number of new form input types. These new features provide better input control and validationThis chapter provides a comprehensive overview of these new input types:
Color
Date
Datetime
Datetime-local
Email
Month
Number
Range
Search
An already existing input type HTML code example:
The code is as follows:
text field radio button check box drop down list password domain Submit button clickable button image button hidden domain reset button file domain In HTML5, a number of new forms input input types have been added to enable better
HTML5 added a variety of enumeration values for the type of input, to express different meanings, colleagues have the validation function, if the format is not correct, the browser will provide the original error message, called Super Bull X, as follows:
Keyword
Data type
Hidden
Any character
Text
Single-line text
Search
Sin
In many pages and Web applications have entered the date and time of the place, the most typical is the booking of air tickets, train tickets, hotels, pizza and other sites.Before HTML5, the most common scenario for such page requirements was to select components with JavaScript dates. This is almost undisputed and has no choice. You can search for a "JavaScript Date selection box" and you'll find countless optional JavaScript components. Most of thes
In many pages and Web applications have entered the date and time of the place, the most typical is booking air tickets, train tickets, hotels, pizza and other sites.
Before HTML5, the most common scenario for such page requirements was to select components with JavaScript dates. This is almost undisputed and has no choice. You can search for the JavaScript date selector box and you'll find countless optional JavaScript components. Most of these date
In this article we look at what is the input box background text hint effect, as shown in:This effect is now very popular online, but most of it is implemented using JavaScript. But HTML5 gives us a new way to implement pure HTML without any JavaScript, just input add the new attributes in the HTML5 specification to yo
In the past, we used a lot of JS verification to create web page input boxes. Now, HTML5 writing is not so troublesome, next I will introduce the newly added types of HTML5 input applications. In the past, we used a lot of JS verification to create web page input boxes. Now,
Use CSS to modify the HTML5 input placeholder color (reproduced), html5placeholder
Problem: Chrome supports the input = [type = text] placeholder text attribute, but the following CSS styles do not work:
input[placeholder], [placeholder], *[placeholder] { color:red !important;}
HTML code:
The running result value is
Before introducing the placeholder attribute of HTML5, we have implemented some page examples for everyone to refer to, but the background text in these examples is gray, the style is very simple, in fact, they can do more beautiful, The CSS3 provides a special rule attribute to beautify the background tip information for input boxes implemented with placeholder. Let's look at how to use a dedicated CSS pro
(for details about the game loop, see: HTML5 game framework cnGameJS development record (game loop )),Therefore, the binding of keyboard keyup and keydown often fails to achieve the expected effect.For example, if you want to keep the element moving to the left when you press the left button on the keyboard:
cnGame.input.onKeyDown("left",function(){ player.move(-10); })
We will find that this method cannot be well applied to frame animation progr
Comments: You may be aware of the HTML5 improvements. Next I will introduce two new input element types: email and url. Let's take a look at their benefits with the Code. If you are interested, refer to the previous blog post. We have discussed some HTML5 improvements, such as placeholder, prefetching, and webStorage, the following describes two new
Http://www.w3school.com.cn/tags/tag_input.asp
HTML instance
A simple HTML form that contains two text input boxes and a submit button:
Give it a shot yourself.
(You can find more instances at the bottom of the page) browser support
IE
Firefox
Chrome
Safari
Opera
All browsers support Definitions and Usage
The input field has many diff
HTML5 Input type, html5input type
New input types provided by html5. these types can help us better control and verify input.
The following describes the new types:
Emial is used to verify the correct email format. It can be blank and automatically verified when the form is
color : red ; 10 } In Firefox and IE, the normal input text color overrides the placeholder color method:1 ::-webkit-input-placeholder{2 Color:Red;Text-overflow:ellipsis;3}4 :-moz-placeholder{5 Color:#acacac!important;Text-overflow:ellipsis;6}7 ::-moz-placeholder{8 Color:#acacac!important;Text-overflow:ellipsis;9}/* for the future*/ Ten :-ms-input-placeholder{
Today, html5 + css3 is awesome. Next I will introduce the input attributes I used today.
The html5 code is as follows:
By default, placeholder prompts the character autofocus. When the page is loaded, a focus button x-webkit-speech is obtained for Voice Search, the webkit kernel supports the types of files that can be uploaded according to accept (only ap
Google's website is a new place to visit. Today, they found a new HTML5 method-Voice Search on their homepage. Unfortunately, only webkit core browsers can be used. Easy to useYou only need to add attributes in input.X-webkit-speechAn example is as follows:
Input type = "text" x-webkit-speech/>
In this way, a "Microphone" is added to the right of your input box
We've discussed some HTML5 improvements, such as placeholder,prefetching and WebStorage, and here are two new INPUT element types: email and URL. Let's follow the code to see their benefits:
Syntax format:
The new input type attribute replaces text with an email or URL:
The code is as follows:
For example [a-za-z0-9]{3,30}@[a-za-z0-9]+w*. (com|cn|org|ne
the minimum allowable value
Step-Specify a valid digital interval
Value-Specify default value
Input Type: TimeThe search type is used for searching domains, such as site search or Google search. action="form.php"> type="time" name="usr_time"> type="submit">
Effect:
Input Type: URLurlType is used for URL input fields that should
We'll look at the "what CSS selectors" to the change an HTML5 inputs placeholder color. This can differ from browser to browser, so, we'll make sure to cover all of the cases./*Chrome, Opera, Safari*/::-webkit-input-placeholder{Color:#ff6600;Opacity:1; }/*Firefox 19+*/::-moz-placeholder{Color:#ff6600;Opacity:1; }/*Firefox and below*/:-moz-placeholder{Color:#ff6600;Opacity:1; }/*MS IE + +*/:-ms-
* Emailtype= "email" name= "User_email"/>* URLtype= "url" name= "User_url"/>* Numbertype= "number" name= "points" min= "1" Max= "Ten"/>* Rangetype= "range" name= "points" min= "1" Max= "Ten"/>
Properties
value
Description
Max
Number
Specify the maximum allowable value
Min
Number
Minimum allowable value is specified
Step
Number
Specify a valid number interval (if step= "3", the legal number
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.