Toni's answer is good, but I'd rather drop the IDID and explicitly use "input"input, that way all inputs with placeholdersplaceholder get the behavior:
<input type="text" placeholder="your text" /> Note that $(function(){ }); is the shorthand for $(document).ready(function(){ });:
$(function(){ $('input').data('holder',$('input').attr('placeholder')); $('input').focusin(function(){ $(this).attr('placeholder',''); }); $('input').focusout(function(){ $(this).attr('placeholder',$(this).data('holder')); }); })