/ Published in: Other

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (!Modernizr.input.placeholder){ $('input[type=text]').each( function(){ $(this).attr('value', $(this).attr('placeholder') ) .focus( function(){ var ph = $(this).attr('value'); $(this).attr('value','').blur( function(){ if($(this).attr('value').length < 1 ){ $(this).attr('value', ph); } }) }); } ); }
Comments
