Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML input placeholder text does not show in firefox

Tags:

html

firefox

I have the following input field

<input type="text" id="search-box" placeholder="input the name" />

the placeholder text sets the default value of the field which is "input the name". If you click the field the text disappears so that you can type the name in the field.

the placeholder text is shown in Chrome but not in Firefox, how to fix this firefox problem?? (I am using firefox 3.6)

like image 399
Mellon Avatar asked Mar 01 '11 13:03

Mellon


People also ask

Why my placeholder is not working in HTML?

If you have an input in your form and placeholder is not showing because a white space at the beginning, this may be caused for you "value" attribute. In case you are using variables to fill the value of an input check that there are no white spaces between the commas and the variables.

How do you use placeholder input?

The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the input field before the user enters a value.


2 Answers

placeholder is a HTML5 attribute that isn't supported in Firefox 3.6

It is supported in Firefox 4.0 and above: https://developer.mozilla.org/en/CSS/%3A-moz-placeholder

like image 159
AlfonsoML Avatar answered Oct 03 '22 00:10

AlfonsoML


I believe the placeholder attribute is WebKit-only (Safari and Chrome). Please see this link for how to make it work in the rest of browsers.

like image 43
Mark Eirich Avatar answered Oct 03 '22 00:10

Mark Eirich