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.
IE9
IE8
IE10
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" />
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';}" />
placeholder HTML5, . , , :
placeholder
EDIT:jQuery, , IE6.
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';" />