Hello, im Pablo Noel

Designer, Skater, Punk

Articulos escritos en June, 2010

Clean inputs on focus

Esta entrada fue publicada el:

08June2010

2 Comentarios

Leer Articulo

A fast and nice way using Jquery to clean input values on focus, and put the default value back when is empty: $(“.clean”).each(function(){ var value = $(this).val(); $(this).focusin(function(){if($(this).val() == value){$(this).val(“”);};}); $(this).focusout(function(){if($(this).val() == ”){$(this).val(value);};}); }); Just add the class “.clean” to your input tag and voilá.

Categories

Social Links