How to Implement JavaScript by entering a prompt in the text box (Password box,

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.