How to add default text that clears on focus to a form in Drupal?
What you want here is:-

a) hook_form_alter to change the form

b) #attached to add JS to the form

c) add clear-text to ['#attributes']['classes'] where necessary.

Then you can use this little JS.

 Drupal.behaviors.clearText = function(context) {
    var inputs = $('input.clear-text:not(.processed)');

    // Store the original values
    inputs.each(function() {
      $this = $(this);
      $this.data('default', $this.val());
    }).addClass('processed');

    // Set up inputs to clear on focus &amp; reload default (if blank) on blur
    inputs
      .focus(function() {
        $this = $(this);
        if ( $this.val() == $this.data('default') ) {
          $this.val('');
        }
      })
      .blur(function() {
        $this = $(this);
        if ( $this.val() == '' ) {
          $this.val( $this.data('default') );
        }
      });
  }