<!DOCTYPE HTML> <html> <header> <meta charset='utf-8'/> <title>demo</title> <script src='js/jquery-1.11.3.js'></script> </header> <body> <input type="text" placeholder="搜索关键词1" class="txt_search1" value=""/> <input type="text" placeholder="搜索关键词2" class="txt_search2" value=""/> <input type="text" placeholder="搜索关键词3" class="txt_search3" value=""/> <script> $(function(){ $("input").bind('mousedown',function(){ $(this).attr('placeholder',''); }) $("input").bind('blur',function(){ $(this).attr('placeholder','搜索关键词') }) }) </script> </body> </html>
placehoder点击文字消失
最新推荐文章于 2019-11-26 17:14:26 发布