Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nicolasblanco/257887 to your computer and use it in GitHub Desktop.
Save nicolasblanco/257887 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
$('#password-clear').show();
$('#password-password').hide();
$('#password-clear').focus(function() {
$('#password-clear').hide();
$('#password-password').show();
$('#password-password').focus();
});
$('#password-password').blur(function() {
if($('#password-password').val() == '') {
$('#password-clear').show();
$('#password-password').hide();
}
});
$('.default-value').each(function() {
var default_value = this.value;
$(this).focus(function() {
if(this.value == default_value) {
this.value = '';
}
});
$(this).blur(function() {
if(this.value == '') {
this.value = default_value;
}
});
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment