Return to Snippet

Revision: 18540
at October 1, 2009 18:48 by chrisaiv


Initial Code
swapValues = [];
	    $(".text_input_values").each(function(i){
	        swapValues[i] = $(this).val();
	        $(this).focus(function(){
	            if ($(this).val() == swapValues[i]) {
	                $(this).val("");
	            }
	        }).blur(function(){
	            if ($.trim($(this).val()) == "") {
	                $(this).val(swapValues[i]);
	            }
	        });
	    });

Initial URL

                                

Initial Description

                                

Initial Title
jQuery: Swap Text within Text Inputs

Initial Tags
jquery

Initial Language
jQuery