/ Published in: jQuery
![](/img/icon_sav.png?v3)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('input:text, textarea').each(function() { if ($(this).val() !== '') { $(this).parents('div.c-wrap').find('label').hide(); //$('body').prepend($(this).val()); } else { //$('body').prepend($(this).val()); } }); $('input:text, textarea').focus(function() { $(this).parents('div.c-wrap').find('label').hide(); }); $('input:text, textarea').blur(function() { if ($(this).val() == '') { $(this).parents('div.c-wrap').find('label').show(); } });
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)