How to add default text that clears on focus to a form in Drupal? I would like to display a default text in a field of a views filter form. That default text would then be hidden "on focus", and would re-appear "on blur".
So far I have tried to follow the instructions given here:
How to add default text that clears on focus with jQuery to a search form text field in Drupal
but with no success.

What I did:

1. Downloaded the Jquery files (https://github.com/mudge/jquery_example/downloads), and copied them in my /sites/all/libraries/mudge-jquery directory

2. Added a helper.js file into that directory with that code

(function ($) {
  Drupal.behaviors.helper =  {
    attach: function(context, settings) {
      $('input#edit-title.form-text.beautytips-module-processed.bt-active').example('TEXT TO HELP'); 
    }
  };
})(jQuery);


3. Created a simple module with that code:

function helper_preprocess_page (&amp;$vars) {
  // Let's add some js to page for the search box.
  $path = drupal_get_path('module', 'helper');
  drupal_add_js($path . '/sites/all/libraries/mudge-jquery/jquery.example.min.js');
  drupal_add_js($path . '/sites/all/libraries/mudge-jquery/helper.js');
}


Still nothing is displayed in my "input#edit-title.form-text.beautytips-module-processed.bt-active" field. What am I doing wrong here?
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') );
        }
      });
  }