title: How to reload jquery on onclick event?
body: <p>I've got a table row where it retrieves data from MySQL and I have included a .onclick function where it opens up a text editor with data inside, but the text editor is only opening for the first row and not the rest in the table.</p>
  
  <p>This is the jQuery code: The first opens the text editor and the second switches the textarea for the text editor which is ckeditor.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(document).ready(function()
      {
          $(".trClass").click(function()
          {
              var id = $(this).attr('id');
              $('#d_'+id).css("display", "block");
              $('#table_id').css("display", "none");
          });
      }); 
  
      window.onload = function()
      {
          CKEDITOR.replace("editor1");
      };
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and this here is echo for the table, I am using a foreach.</p>
  
  <pre><code>echo '
      &lt;tr class="trClass" id="'.$counter.'"&gt;
          &lt;td class="marker"&gt;
              &lt;i class="fa fa-align-left"&gt;&lt;/i&gt;
          &lt;/td&gt;
  
          &lt;td class="title"&gt;
              '.$article_title.'
          &lt;/td&gt;
  
          &lt;td class="content"&gt;
              '.$article_content.'
              &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;section id="d_'.$counter.'" style="display:none;"&gt;
          &lt;textarea id="editor1"&gt;
              &lt;div style="width:468px;"&gt;
                  '.$article_content_full.'
              &lt;/div&gt;
          &lt;/textarea&gt;
      &lt;/section&gt;
  ';
  $counter++;
  }
  </code></pre>
  
  <p>I cannot figure out how to make the <code>CKEDITOR.replace("editor1");</code> load for every table, I tried using .click function within it but it does not work as it doesn't load. Here is the problem, if you click on the first row it opens the text editor if you click on the second it does not; <a href="http://www.goo.gl/dQrLPN" rel="nofollow">http://www.goo.gl/dQrLPN</a></p>