I am using jQuery instead of HTML5 placeholder attribute
<input type="text" name="email" value="Email" onfocus="if (this.value == 'Email') { this.value = ''; }" onblur="if (this.value == '') { this.value = 'Email'; }" onclick="if (this.value == 'Email') { this.value = ''; }" />
this is working fine for type="text" but for type="password" it show only *
How i will use placeholder for password field? Need out in IE8
Advance thanks for answers…
I create a normal input, and on
focusswitch it to a password field, and if the value is empty onblur, then switch it back to a normal input, else leave it as the password field.Here is a working JSFiddle: http://jsfiddle.net/q8ajJ/
The HTML
The Javascript (jQuery)