/ Published in: jQuery

Expand |
Embed | Plain Text
var automessages = []; $(function(){ $('.automessage').each(function(){ automessages[$(this).attr('id')] = $(this).val(); }).focus(function(){ if ($(this).val() == automessages[$(this).attr('id')]) { $(this).val('') } }).blur(function(){ if ($(this).val() == '') { $(this).val(automessages[$(this).attr('id')]) } }); });
You need to login to post a comment.