This jQuery code removes the value of a input text type when the user clicks on the input. $(document).ready(function(){ $('input:text').each(function() { var label = $(this).val(); $(this).focus(function() { if($(this).val() == label) { $(this).val(''); } }); $(this).blur(function() { if($(this).val() == '') { $(this).val(label); } }); }); });
-
Categories
Archives