Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* http://www.gravityhelp.com/forums/topic/font-color-change-input-fields */
- /* working example: http://gravity.chrishajer.com/census/ */
- jQuery(document).ready(function() {
- jQuery.fn.cleardefault = function() {
- return this.focus(function() {
- if( this.value == this.defaultValue ) {
- this.value = "";
- jQuery(this).removeClass('incomplete').addClass('complete');
- }
- }).blur(function() {
- if( !this.value.length ) {
- this.value = this.defaultValue;
- jQuery(this).removeClass('complete').addClass('incomplete');
- }
- });
- };
- jQuery(".clearit input, .clearit textarea").cleardefault();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement