title: Bind a click to a jquery plugin
body: <p>I have followed most of the beginners tutorials, but now I am trying to do a clean jquery plugin. My goal (right now) is to show an alert when a user click on a link (using a plugin).</p>
  
  <p>my code to call the plugin is :</p>
  
  <pre><code>//custom.js
  $(document).ready(function(){    
     $("a").click(function(event){
       alert("TEST1");
       myPlugin();
       event.preventDefault();
     });
   });
  </code></pre>
  
  <p>and my plugin code is :</p>
  
  <pre><code>//myPlugin.jquery.js
  (function( $ ){
    $.fn.myPlugin = function() {
  
      alert("TEST2");
  
    };
  })( jQuery );
  </code></pre>
  
  <p>TEST1 is showed but not TEST2 !</p>
  
  <p>What's wrong ?</p>
  
  <p>Thank you very much for your help!</p>