Created
May 16, 2011 19:25
-
-
Save jwlawrence/975134 to your computer and use it in GitHub Desktop.
Helpful jQuery functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ghost Text | |
$(".populate input").each(function() { | |
if ($(this).val() == "") { | |
$(this).val($(this).attr("title")); | |
} | |
}); | |
$(".populate input").focus(function() { | |
if ($(this).val() == $(this).attr("title")) { | |
$(this).val(""); | |
} | |
}); | |
$(".populate input").blur(function() { | |
if ($(this).val() == "") { | |
$(this).val($(this).attr("title")); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment