This is probably stupidity on my part, but where am I going wrong with this?
$(function() { $('textarea#comment').each(function() { var $txt = $(this).val(); $(this).bind('focus', function() { if($(this).val($txt)) { $(this).val(''); } }); }); }); Basically on focus I want to check if the value is the default value in this case 'Enter your comment', then if it is change the value to nothing.
Anyone know how to do this? I'm guessing its relatively simple. What the code does at the moment is removes any value.