Return to Snippet

Revision: 30297
at May 19, 2011 00:27 by prsjohnny


Updated Code
if($(input).val() == ""){
	$(input).val("Search Here...");
}

$(input).focus(function(){
	if($(input).val() == "Search Here..."){
		$(this).val("");
	}
});

$(input).blur(function(){
	if($(input).val() == ""){
		$(input).val("Search Here...");
	}
});

Revision: 30296
at August 12, 2010 23:49 by prsjohnny


Updated Code
if($(input).val() == ""){
	$(input).val("Search Here...");
}

$(input).focus(function(){
	$(this).val("");
});

$(input).blur(function(){
	if($(input).val() == ""){
		$(input).val("Search Here...");
	}
});

Revision: 30295
at August 11, 2010 14:42 by prsjohnny


Initial Code
if($(input).val() == ""){
$(input).val("Search Here...");
}

$(input).focus(function(){
$(this).val("");
});

$(input).blur(function(){
if($(input).val() == ""){
$(input).val("Search Here...");
}
});

Initial URL

                                

Initial Description
Display a default value in a text field that disappears on focus and reappears on blur **if** the field is blank.

Initial Title
Textbox place holder

Initial Tags
js, search, forms, jquery

Initial Language
jQuery