/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var searchBox = $("#edit-search-theme-form-1"); var searchBoxDefault = "Enter keywords"; searchBox.attr("value", searchBoxDefault); searchBox.focus(function(){ if(jQuery.trim($(this).attr("value")) == searchBoxDefault) $(this).attr("value", ""); }); searchBox.blur(function(){ if(jQuery.trim($(this).attr("value")) == "") $(this).attr("value", searchBoxDefault); })