Reputation: 629
Works great in all other browsers except IE9.Is there any fix?Have tried .attr("value") as well but it still does not work.
$searchbox.focus(function(e){
$(this).val("");
});
$searchbox.blur(function(e){
if($(this).val()=="")
$(this).attr("value","Search For Music...");
});
Upvotes: 0
Views: 596
Reputation: 8804
$searchbox.focus(function(e){
$(this).val("");
});
$searchbox.blur(function(e){
if($(this).val(""))
$(this).val("Search For Music...");
});
did you check like this?
but you want to clear text on focus and add text "Search For Music" if blank text, if so you can do like
$searchbox.focus(function(e){
if($(this).val() == "Search For Music...")
$(this).val("");
});
$searchbox.blur(function(e){
if($(this).val() == "")
$(this).val("Search For Music...");
});
Upvotes: 2