title: Javascript- onclick event not working?
body: <p>My codes are</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div id="main"&gt;
  &lt;div class='hide' data-id='one'&gt;Description one&lt;/div&gt;
  &lt;div class='hide' data-id='two'&gt;Descripttion two&lt;/div&gt;
  &lt;div class='hide' data-id='three'&gt;Description Three&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>$('.hide').click(function(){
      if($(this).data('id')=='one'){$('#main').html(myData)};
  });
  
  $('button').click(function(){alert('thank you');});
  
  var myData = 'thank you&lt;br/&gt;&lt;button&gt;previous&lt;/button&gt;';
  </code></pre>
  
  <p>Why my button on click event i.e. alert isn't working?</p>