title: Bind event to element using pure Javascript
body: <p>I'm writing an API and unfortunately need to avoid any jQuery or 3rd party libraries. How exactly are the events bound to elements through jQuery?</p>
  
  <p>jQuery example:</p>
  
  <pre><code>$('#anchor').click(function(){
      console.log('anchor');
  });
  </code></pre>
  
  <p>I'm close to writing a onClick attribute on the element out of frustration, but I would like to understand the link between the jQuery event and DOM element.</p>
  
  <p>How exactly does the element know to fire a jQuery event when the markup itself is not changed? How are they catching the DOM event and overriding it?</p>
  
  <p>I have created my own Observer handler but cant quite understand how to link the element to the Observer events.</p>