/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function setSearchKeywordField(selector, string){ var selector = $(selector); selector.attr({ value: string }).focus(function(){ if ($(this).val() == string) { $(this).val(""); } }).blur(function(){ if ($(this).val()=="") { $(this).val(string); } }); } setSearchKeywordField("#header .right form input.textfield", "Search");