Skip to content

Instantly share code, notes, and snippets.

@timtrueman
Created January 9, 2011 03:28
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 timtrueman/771390 to your computer and use it in GitHub Desktop.
Save timtrueman/771390 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$(':text,:password').live('focus',function(event) {
if (typeof event.target.original_value == "undefined") {
event.target.original_value = event.target.value;
}
if (event.target.value == event.target.original_value) {
event.target.value = '';
}
$(event.target).css('color','#000')
});
$(':text,:password').live('blur',function(event) {
if (event.target.value == '') {
event.target.value = event.target.original_value;
$(event.target).css('color','#999')
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment