$(" .search-text").focus(function(){ //.search-text 换成对应的input类名或者id名 $(this).attr("value",""); }).blur(function(){ $(this).attr("value","123"); });