When the search box hits the prompt text disappears when the prompt text appears

Source: Internet
Author: User
Prompt text appears when the text disappears when the search box clicks This example is a search box, click the Search box, the default prompt text automatically clear, leaving again display the default prompt text
 
realize click to clear left back effect focus is: 
<input type= "text" name= "Q" title= "Search class=" Searchinput "id=" searchinput "value=" Please enter the Merchant name address "onkeydown=" if ( event.keycode==20) {} '  onblur= ' if (this.value== ') value= ' Please enter the merchant name address '; ' onfocus= ' if (this.value== ' Please enter merchant name address ') Value= '; value= "Please enter the Merchant name address"/>
Special supplement: HTML5 can also directly implement similar functions

Please refer to my other blog post "HTML5 easy to implement search box hint text Click Disappear-and placeholder color settings"
http://blog.csdn.net/pspgbhu/article/details/51465514

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.