The effect you want to achieve:
When you lose focus:
Check input always:
Dynamically change the properties of the type of input via JS:
There are already relevant information on the Internet. Take notes here. Original article Address: http://www.jb51.net/article/43140.htm
<input name= "password" type= "password" id= "password" class= "input" style= "display:none;"/>
$ ("#showPwd"). focus (function () {
var Text_value = $ (this). Val ();
if (Text_value = = This.defaultvalue) {
$ ("#showPwd"). Hide ();
$ ("#password"). Show (). focus ();
}
});
$ ("#password"). blur (function () {
var Text_value = $ (this). Val ();
if (Text_value = = "") {
$ ("#showPwd"). Show ();
$ ("#password"). Hide ();
}
});
How to display the Chinese character "password" when the password box loses focus and the input content is displayed as the password "**********" when it gets focus