title: jquery trigger custom global event
body: <p>I would like to do something like this</p>
  <pre><code>$(&quot;#A&quot;).on(&quot;click&quot;, function(){
      $.event.trigger({type:&quot;custom&quot;});
  });
  $(&quot;#B&quot;).on(&quot;custom&quot;, function(e){
      $(&quot;#B&quot;).removeClass(&quot;hidden&quot;);
  });
  $(&quot;#C&quot;).on(&quot;custom&quot;, function(e){
      alert(&quot;something&quot;);
  }
  </code></pre>
  <p>Where I trigger a custom event using JavaScript. I would then like to be able to use the <code>.on</code> function on different elements throughout the page. Clicking the &quot;#A&quot; would then trigger the event for all registered elements.</p>
  <p>I noticed that the trigger function is called on an element instead of globally, which is not what I want.</p>
  <p><a href="http://jsfiddle.net/qLKn3/2/" rel="nofollow noreferrer">Fiddle</a></p>