title: JQuery function fn() is not defined
body: <p>I am using a third party Jquery plugin named <code>sumoselect.js</code> in my project . </p>
  
  <p>And inside of it , once my select box is rendered , I appended a div element with an anchor tag within and want to handle a click event.</p>
  
  <p>I did something like :</p>
  
  <pre><code>            //## Create New Application Specific code
              createNew: function () {
                  var O = this;
                  O.optDiv.append($('&lt;ul class="form-control"&gt;&lt;li&gt;&lt;div style="margin-top:4px;"&gt;&lt;a class="ispicon ispicon_plus" style="padding-left:12px;cursor:pointer;" data-toggle="modal" data-target="#addgroup" title="Create New"&gt; Create New&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;').on('click', handleClick));
              },
  
              handleClick: function () {
                  alert("Oh My");
              },
  </code></pre>
  
  <p>But it says <code>handleClick</code> is not defined.</p>
  
  <p>Even putting the function on top of <code>createNew</code> throws the same error.</p>
  
  <p>What am I missing ?</p>