Skip to content

Instantly share code, notes, and snippets.

jQuery.placeholder = function() {
$('[placeholder]').focus(function() {
var input = $(this);
if (input.hasClass('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
if (input.val() === '') {