title: Click event working on a single table row?
body: <p>I have a problem with selecting a single row of a table in jQuery which is identified with a class <code>edit</code> and then a variable number when defined, so my first row would have a class <code>edit1</code>, the second one <code>edit2</code> and so on.</p>
  
  <p>My concern is that I can fire the click event on the very last row in my table and I obviously get why, but I can't find information on how to actually dynamically select those rows.</p>
  
  <p>I tried <strong>.each</strong> method like this:</p>
  
  <pre><code>$('table tr').each(function(){
          $('.edit{{server-&gt;id}}').on('click', function (){
                  $(this).attr("contenteditable", "true");
                  $(this).addClass('form-group');
                  $('div.editable').addClass('form-control');
                  $('div.hidbtn').removeAttr('hidden');
          });
   });
  </code></pre>
  
  <p>And it's obviously not working because my <code>{{server-&gt;id}}</code> here just refers to the last <code>{{server-&gt;id}}</code> taken from a foreach that creates the rows.</p>
  
  <p>How can I put this in a way to select every single row and fire that click event for every single one ?</p>
  
  <p>A foreach inside the script ?</p>
  
  <p>I'm sorry if this can result such a stupid question..</p>
  
  <p>I'm using Laravel 5.4 by the way.</p>
  
  <p>Thanks in advance!</p>