Skip to content

Instantly share code, notes, and snippets.

@robneu
Forked from billrobbins/clear-fields.js
Last active December 17, 2015 15:18
Show Gist options
  • Save robneu/5630197 to your computer and use it in GitHub Desktop.
Save robneu/5630197 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($) {
$.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
}
});
};
$(".gform_wrapper .gplaceholder").cleardefault();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment