Search code examples
javascripthtmlpasswordsplaceholder

HTML: HTML5 Placeholder attribute in password field issue- shows normal text?


I am making a Login form, in which there are two fields-

simplified:

<input type="text">
<input type="password" placeholder="1234567" >

In my tests (FF, Chrome) the placeholer shows grey text. How can I have the placeholder text in password 'dots' ? And have placeholder support in IE?

eg. the user sees a fake grey password, not the text 1233467.

(I have jquery available)

Thankyou very much,

Harley

EDIT: Looks like this is the wrong way to use placeholder. However, how can I get IE support? Thanks


Solution

  • Try using the password dot code in the placeholder like so:

    placeholder="&#9679;&#9679;&#9679;&#9679;&#9679;"
    

    For support in IE please refer to other threads such as Showing Placeholder text for password field in IE or placeholder works for text but not password box in IE/Firefox using this javascript