placehoder点击文字消失

HTML>
<html>
<header>
    <meta charset='utf-8'/>
    <title>demotitle>
    <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点击文字消失)