I have the password field on page. I want to display text \"Enter password\" on screen before entering password but on focus when user enter password it should go back to passwo
You can either give it an image background with the text Enter Password
that you change dynamically using javascript (ideally by just removing a CSS class),
or
or place a fake input
that you replace with javascript for a password input
.
I'm not sure how well it would cross browser to change the type of input
on the fly.
document.getElementsByTagName("input")[0].type = "text" /* change a hidden field to text*/
works on Firefox, but I wouldn't rely on it working well on IE without testing.