Skip to content

Instantly share code, notes, and snippets.

@roykolak
Created January 29, 2009 19:33
Show Gist options
  • Save roykolak/54697 to your computer and use it in GitHub Desktop.
Save roykolak/54697 to your computer and use it in GitHub Desktop.
Prompt Text
$(':input.promptText').focus(function() {
if($(this).val() == $(this).attr('title')) {
$(this).val('');
}
});
$(':input.promptText').blur(function resetField() {
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