Return to Snippet

Revision: 6715
at June 10, 2008 10:49 by jeppeb


Initial Code
function clean(element, what){
	value = element.value;
	if(value==what)element.value="";
	if(value=="")element.value=what;
}

Initial URL

                                

Initial Description
When there's a value in a textbox, like 'search', it disappears when you click on it, and reappears when you leave (blur) it. But only if you haven't filled in anything ofcourse.
Use it like this:

Initial Title
Form value 'cleaner'

Initial Tags
form

Initial Language
JavaScript