I'm using this js to display default password, when user clicks it automatically clears default value, if user deselects without entering anything default value re-appears.
I used it for all my fields, but obviously for password it is trickier! :)
How would you do it?
<input
type="password"
onblur="this.value=!this.value?'Password':this.value;"
onfocus="this.select()"
onclick="if (this.value=='Password'){this.value='';}"
name="pwd"
id="user_pass"
class="input"
value="Password"
size="20"
tabindex="20" />
Try This out - http://roshanbh.com.np/examples/text-in-password/
Please use the below solution,
because first solution works well but if u empty the password field, it will not convert to its default value which is a text. So try above solution.
You need to create a plain text input as a placeholder. This code will do that for you without exposing any variables to the global scope:
JSFiddle
Were you thinking of
<input placeholder='Password' type='password'/>
?This is your solution: http://jsfiddle.net/cgP5K/1/