title: Click function with addClass not working in dynamic html()
body: <p>The click function is not working in a dynamic added html. The class is tested in the new element as true but it ignores the click function for that class - although it is working fine in other elements.</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>// The added html element + addClass
  $('#sendResultMsg').html('&lt;a href="javascript:void(0);" id="closeButt"&gt;Close&lt;/a&gt;');
  $('#sendResultMsg').find('#closeButt').addClass('closeButton');
  
  // just for testing this alert confirms hasClass as true
  alert($('#closeButt').hasClass('closeButton'));
  </code></pre>
  
  <p>the '#sendresult' is a  element in page and the html appears fine with the 'Close' link but when clicked nothing happens. The click function assigned to the class works fine in 2 other elements in page and its like this:</p>
  
  <pre><code>$('.toggleContactBox, .closeButton).on('click',function () {
    cntBox = $('#contactBox');
    cntBoxPos = cntBox.css('right');
    if (cntBoxPos &lt;= '-550px') {
      cntBox.animate({ right: '0px' }, 200);
    } else {
      cntBox.animate({ right: '-550px' }, 200);
    }
  });
  </code></pre>