Placeholder does not work properly in all browsers

Possible duplicate:
How to get placeholder text in firefox and other browsers that do not support the html5 parameter?

I created a popup for login, and I used placeholder to show the name of the input field, but in other browsers such as IE9, IE8and the IE10placeholder text on the input is not even displayed.

How can I solve this problem? Is there any other way to fill in the input field?

<input name="username" type="text" value="" placeholder="Username" />
+5
source share
3 answers

As OEZI said, it is 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';}" />
+2
source

placeholder HTML5, . , , :

EDIT:
jQuery, , IE6.

+1

Placeholder is not supported by IE8 so far. you can use

<input type="text" name="username" onfocus="if(this.value=='Username') this.value='';" onblur="if(this.value=='') this.value='Username';" />
+1
source

All Articles