/ Published in: jQuery
Small function to create a replacement for the placeholder functionality in HTML5. This works in IE as well.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('input.empty').focus(function(){ if($(this).val() == $(this).attr('data-placeholder')){ $(this).val('') } }); $('input.empty').blur(function(){ if($(this).val() == ''){ $(this).val($(this).attr('data-placeholder')) } });
URL: www.censmedia.nl