How to Implement JavaScript by entering a prompt in the text box (Password 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.
The above content is a small Editor to share with you how to implement the knowledge of prompts in the password box, I hope you like it.
Articles you may be interested in:
- Flex text box drop-down prompt
- Smart prompt JS code in the page text box
- Asp.net page text box prompt JSCode (upgraded version)
- Friendly prompt when entering the text box in javascript
- JavaScript code for text box effects with automatic prompts
- JavaScript text box drop-down prompt (automatic prompt)
- Simple JS automatically prompts text box code
- Use JQuery to show hidden text in the mouse-click Text Box
- Automatically prompt when text box is entered (like Baidu or google)
- Two methods are provided to enable text box input to disappear