title: How to use two 'onclick' event
body: <p>Below is my code, why isn't it working when I click on <strong>Appended text</strong> ?</p>
  
  <p>1: click on <strong>This is a paragraph.</strong></p>
  
  <p>2: click on <strong>Appended text</strong> </p>
  
  <p>3: Must show <strong>Appended item</strong> with color red.</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>$(document).ready(function(){
      $(".ali").click(function(){
          $(this).parent().append("&lt;b class='reza'&gt;Appended text&lt;/b&gt;");
      });
      $(".reza").click(function(){
          $(this).append("&lt;li style='color:red'&gt;Appended item&lt;/li&gt;");
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;p&gt;&lt;span class="ali"&gt; This is a paragraph. &lt;/span&gt; &lt;/p&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>