HTML5 native support placeholder, for unsupported browsers (IE), can be implemented with JS simulation.
JS Code
Copy Code code as follows:
(function () {
Determine whether to support placeholder
function Isplaceholer () {
var input = document.createelement (' input ');
Return "placeholder" in input;
}
Unsupported Code
if (!isplaceholer ()) {
HTML5 has made many enhancements to the Web Form, such as input type, Form validation, and so on.Placeholder is another property added by HTML5, and when input or textarea is set, the content of the value is displayed as a gray hint in the text box, and the hint text disappears when the text box gets the focus. In the past to achieve this effect is the use of JavaScript to control to achieve, Firefox, Google Chrome and other representations of its support, only ie there is vainly disobey sense A
Placeholder is another new attribute of html5. when this attribute is set in input or textarea, the content of this value will be displayed as a gray prompt in the text box. When the text box gets the focus, the prompt text disappears HTML5 makes many enhancements to the Web Form, such as the type and Form Validation added by input.
Placeholder is another new attribute of html5. when this attribute is set
Placeholder is a newly added property of HTML5 that provides a hint (hint) that describes the values expected by the input fields. The hint appears when the input field is empty and disappears when the field gets focus. The placeholder property applies to the following types of input tags: text, search, URL, telephone, email, and password.Let's look at the effect in Google Chrome first:When you get focus:In
CSS: HTML5 placeholder color, html5placeholder
Placeholder is a new property (input, textarea) in the html5 input box ).
It is mainly used to display text by default when no content is input in the input box, for example, "enter an account name". For this attribute, different browsers display different styles, therefore, you need to unify the following:
Input:-webkit-input-
A custom Placeholder attribute plug-in implemented by jQuery, jqueryplaceholder
The new placeholder attribute of the text box in HTML5 is a very useful attribute, but it is not supported by the IE series until IE9, which makes everyone hesitate when using this attribute. I have written many similar widgets, but none of them are very common. Here I will share a jQuery plug-in with a progressive enhancement o
The label provides an elegant way to configure an externalized parameter, but only one copy of the tag can exist in the spring configuration file!!!It is well known that the spring container is a discovery mechanism using reflection scanning, which instantiates an instance through the namespace of a tag, and when spring detects that one org.springframework.beans.factory.config.PropertyPlaceholderCVonfigurer of the beans in the container stops the remaining PropertyPlaceholderConfigurer scan, the
Since placeholder is a new attribute of html5, it is conceivable that only html5 browsers support placeholder. Currently, the latest firefox, chrome, safari, and ie10 are supported, and neither ie6 nor ie9 are supported. Placeholder is html5
It provides the hint that can describe the expected value of the input field. The hint is displayed when the input field is
In IE 8 and earlier browsers, The placeholder attribute is not supported. ie8placeholder
The following code does not support the placeholder attribute in IE8 and earlier browsers.
Principle: Write the value of placeholder into the control as the content, and add the control event for simulation.
; (Function () {if (! ('Holder' in document. createElement ('input')
There are many articles on the internet to solve the compatibility problem, many moves, learn this trick, let you easy to deal with the compatibility of placeholder, call me a good person, take away, thanks ....The placeholder property is added for input in HTML5. Provides a placeholder on input that displays the prompt information for the expected value of the i
Placeholder graphics, as the name suggests, are temporary graphics that are used before you are ready to add final graphics to a Web page. It allows you to make a Web page without an ideal graphic--insert a placeholder shape where you need to use the graphic to "occupy" the "site" first.
First, insert placeholder graphics
Position the cursor where you want to ins
The content comes from Mu-class network, to pick up their own blog, only for the convenience of browsing.——————————————————————————————————————To modify all input placeholder:::-webkit-input-placeholder { Color:red;}:-moz-placeholder {/* * Firefox 18-*/ Color:red;}::-moz-placeholder {/* Firefox 19+ */color:red;}:-ms-
Let Placeholder dry up in IE, placeholderie up
There are a lot of articles on the Internet to solve the compatibility problem in this aspect, many tricks, learn this trick, let you easily solve the compatibility of Placeholder, let me good people, take it away, thank you ....
The placeholder attribute is added for input in HTML5. A
Placeholder is another new attribute of html5. when this attribute is set in input or textarea, the content of this value will be displayed as a gray prompt in the text box. When the text box gets the focus, the prompt text disappears. In the past, JavaScript was used to control this effect. firefox, googlechrome, and so on indicate their support, but IE does not support HTML5 and has made many enhancements to Web forms, for example, type and Form Val
This article mainly introduces a custom Placeholder attribute plug-in implemented by jQuery. The complete source code of the plug-in is provided at the end of this article, if you need it, you can refer to the new attribute placeholder of the text box in html5. but this attribute is not supported by IE series and IE9, this makes everyone hesitate when using this attribute. I have written many similar widget
This is very common in the spring configuration file.Context:property-placeholder greatly facilitates the configuration of our database.[HTML]View PlainCopy
Just add a line to the spring configuration file:context:property-placeholder? location="classpath:jdbc.properties"/> The location value is the position of the parameter profile, and the parameter profile is usually placed in the SRC directory. The
5 ways to change the placeholder text color of Uitextfield The goal is to have multiple uitextfield on a page, and when the user focuses on a textfield, the placeholder text of the text box turns gray to white. When the text box loses focus, the placeholder color changes back from white to gray.1. Place UilabelThe simplest and most stupid method is to put a uilab
It is also a minor problem that has recently been encountered. The placeholder property is not supported because IE9 is the following input. Find a solution on the internet and take it decisively. As Mr. Lu Xun said, ' Take doctrine ': Use the brain, give out your eyes, take it yourself! Thank. Jiehuaxianfo here to share under the record.The usage is simple, introduce placeholder.js in the code, and add the following piece of code to the line.12345 //
The following browser tests are passed in Windows system: Google Chrome 18,firefox 12,ie 9,ie 6,opera 11.5. In the Android 4.0 system also tested, native browser and opera Mobile12 Basic pass, the flaw is to get focus will empty placeholder prompts.
Jquery.placeholder.zhihu.js section:
The code is as follows
Copy Code
/** HTML5 placeholder Pollfill*-use absolute positioning in
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.