Return to Snippet

Revision: 43915
at April 3, 2011 03:12 by joshangell


Initial Code
		jQuery('input, textarea').each(function() {
			var defaultval = this.value;
			
			jQuery(this).focus(function() {
				if(this.value == defaultval) {
					this.value = '';
		    	}
			});
			
			jQuery(this).blur(function() {
				if(this.value == '') {
					this.value = defaultval;
				}
			});
		});

Initial URL

                                

Initial Description

                                

Initial Title
jQuery form clearing

Initial Tags
textmate

Initial Language
jQuery