title: Jquery attribute value for current element
body: <p>I am trying to find value of an attribute for clicked element. All elements are dynamically populated.</p>
  
  <p>I am unable to get value of attribute. what may be the issue?</p>
  
  <pre><code>&lt;span title="cancel work" class="cancel" myid="111"&gt;&lt;i class="fa fa-stop"&gt;&lt;/i&gt; Stop work&lt;/span&gt;
  
  $(document).on('click','.cancel',(function(){
      alert(this.attr("myid"));
  }));
  </code></pre>
  
  <p>This is the error message I get</p>
  
  <blockquote>
    <p>Object doesn't support property or method 'attr'</p>
  </blockquote>