Possible Duplicate:
How do I get placeholder text in firefox and other browsers that don't support the html5 tag option?
I have created a login popup box and I used placeholder to show the input field name, but in other browsers like IE9
, IE8
and even IE10
is not showing placeholder text in the input.
How can I resovle this issue? Is there any other way to fill the input field?
<input name="username" type="text" value="" placeholder="Username" />
As OEZI said it's not supported in all browsers.
try this instead
<input name="username" type="text" value="" onfocus="if (this.value == 'Username') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Username';}" />
placeholder
is part of the new HTML5-features wich isn't fully supported by all browsers till now. for more information, please check:
EDIT:
if you're using jQuery, there's this little plugin to add support for all browsers down to IE6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With