I use thisone, it's only Javascript.
I simply have an input element with a value, and when the user clicks on the input element, it changes it to an input element without a value.
You can easily change the color of the text using CSS. The color of the placeholder is the color in the id #IEinput, and the color your typed text will be is the color in the id #email. Don't use getElementsByClassName, because the versions of IE that don't support a placeholder, don't support getElementsByClassName either!
You can use a placeholder in a password input by setting the type of the original password input to text.
Tinker: http://tinker.io/4f7c5/1
- JSfiddle servers are down!
*sorry for my bad english
JAVASCRIPT
function removeValue() {
document.getElementById('mailcontainer')
.innerHTML = "<input id=\"email\" type=\"text\" name=\"mail\">";
document.getElementById('email').focus(); }
HTML
<span id="mailcontainer">
<input id="IEinput" onfocus="removeValue()" type="text" name="mail" value="mail">
</span>
<input>
); an attribute is a key-value pair inside the pointy-brackets (likeplaceholder="This is an attribute value"
). Leaving the question as-is, so that future people who ask the same question can find it. – MilburnIE9
by the demo given in same site. – Ormandrequired
attribute then Firefox will highlight the field in red thinking the user has typed nothing in it. – Mid<!--[if lt IE 10]>
. Only fix what's broken. – Silurian