Sometimes we need to have some hint language in the login form, for example, "Please enter the user name" and "Please enter the password" and other languages, as well as the user name, but in the Password box appears "Please enter the password" Such language is a bit of trouble, because the password box entered content will not be displayed in plain text. If you have a compatibility problem with dynamic control of the type attribute, if input already exists on the page, the Type property is read-only in the IE8 and IE8 browsers below. So you have to think of another way, the code is as follows:
The above code to achieve our requirements, you can appear in the hint of plaintext, when the password is entered in the password mode.
The principle of implementation is very simple, in the default state with the type= "text" box display, when clicked text box, with the type= "Password" password box display, the original display of the text box hidden, that is, made a replacement.
The above content is small to share the JavaScript how to achieve in the password box to appear in the language of the relevant knowledge, I hope you like.