JavaScript implementation input box (Password box) prompts, javascript input box
Sometimes we need to have some prompt languages in the login form, such as "enter user name" and "Enter Password, however, it is a bit difficult to enter a password in the password box, because the entered content in the password box is not displayed with an explicit code. If the type attribute is dynamically controlled, there will be compatibility issues. If the input already exists in the page, the type attribute is read-only in IE8 and IE8 browsers. So you have to find another method. The Code is as follows:
<! DOCTYPE html>
The above Code meets our requirements and prompts are displayed. When a password is entered, it is entered as a password.
The implementation principle is very simple. It is displayed in the type = "text" text box by default. When you click the text box, it is displayed in the type = "password" password box, the original text box is hidden, that is, a replacement is made.
Articles you may be interested in:
- Javascript input box prompt list Effect
- Js Code similar to the smart prompt in the Baidu input box
- Code Implementation of the auto-Prompt function in the email box of the js input box
- Js operation input box prompts and responds to mouse events
- How to enter the number of words in the JavaScript dynamic prompt input box
- Javascript-like Baidu input box prompts automatic drop-down completion