This.type = 'password' doesn't work in IE, but all other browsers it does
I have an input field that is set to type = "text" by default so that it can display the word Password. I have the following to change it to a password field when the user selects it, which works fine in any browser I've tried other than Internet Explorer.
onfocus="this.type='password';"
How do I make this work in IE?
+2
source to share
3 answers
You are better off using a <label> with the text "password" rather than displaying it inside the control itself. You can make the shortcut as it is inside the textbox using css. List Apart has a good article on things like this: http://www.alistapart.com/articles/makingcompactformsmoreaccessible/
+1
source to share