title: Wildcard delegation with jQuery
body: <p>I want an event to be able to be triggered by any element with the appropriate context. Right now I'm doing this:</p>
  
  <pre><code>$(document.body).on('mycustomevent', '*', function(e) {
    e.stopPropagation()
    console.log('mycustomevent')
    console.log(this)
  }
  </code></pre>
  
  <p>Is there anything wrong with this? Is there a better way?</p>
  
  <p>Another related question is how would I trigger this event for an element not attached to the document? ie:</p>
  
  <pre><code>$('&lt;div&gt;&lt;/div&gt;').trigger('mycustomevent')
  </code></pre>