Using Simple jQuery click() events in Drupal 7
(function ($) {
// To understand behaviors, see https://drupal.org/node/756722#behaviors
Drupal.behaviors.ss2 = {
  attach: function(context, settings) {

  $("h1").click(function() {
    alert('clicked!');
  });
}}

})(jQuery); 


be careful with braces at the end, and rename ss2 as you want, it's just for example...