title: Why does event.target inside jquery does not work
body: <p>Following is the code, I was trying to place. It is very simple yet the event.target does not fire whereas other normal event handlers work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function($){
    
    var container = $('#container');
    
    function init() {
      container.on('click', open)
    }
    
    function open() {
    
      if(event.target === container) {
        alert ("hi");
      }  
    }
    
        init();
  
  })(jQuery);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body, html {
    padding:0;
    margin:0;
  }
  
  #container {
    height: 500px;
    width:800px;
    margin:0 auto;
    background-color:#444;
  }
  
  h1{
    color:white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id = "container"&gt;
    &lt;h1&gt;Testing&lt;/h1&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>First problem is that, TypeError: $(…). is not a function</p>
  
  <p>The second problem is that although it works in google chrome, it still shows the above error. </p>
  
  <p>The third error is that, although the function runs in the browser, it does not work when I place, event.target === container command. However, if I simply console.log event.target, it returns me the div id of container. However, when I add that check of the event.target, it stops working.</p>
  
  <p>I am stuck, could anyone help me with an explanation of why this problem occurs</p>
  
  <p>Thanks</p>