Skip to content

Instantly share code, notes, and snippets.

@mape
Created May 12, 2010 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mape/398308 to your computer and use it in GitHub Desktop.
Save mape/398308 to your computer and use it in GitHub Desktop.
$('.hasHint').live('focus', function (event)
{
if (!$(this).data('origin-text'))
{
$(this).data('origin-text', $(this).val());
}
if ($(this).data('origin-text') == $(this).val());
{
$(this).val('');
}
$(this).removeClass('hint');
}).live('blur', function (event)
{
if ($(this).val() == '')
{
$(this).val($(this).data('origin-text')).addClass('hint');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment