title: Give different ID to each element in for loop
body: <p>I have a far loop which check the number and output the result to number of that. </p>
  
  <p>For exmaple, in below picture the "cut image" is displayed in multiples times. I have  tag in the far loop so it outputs the image according to number of times. And that number come from database. </p>
  
  <p><strong>MY Question.</strong> 
  Obviously all the images in first row will have same ID. Currently user can only click the first image of the row. I would like to give each element different ID  if possible. Than I would like to use JQuery to add click event. So if I click on 4th image in first row, it alert message and if i click 5th image it shows different alert message.</p>
  
  <p>How I can assign different ID to each element in far loop so  it does only make first Image clickable but instead all elements clickable. </p>
  
  <p><a href="https://i.stack.imgur.com/KiGyZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KiGyZ.png" alt="enter image description here"></a></p>
  
  <p>My loop</p>
  
  <pre><code> &lt;table class="table table-bordered"&gt;
      &lt;thead&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;?php
          for($x=0; $x &lt; $row['noof10s_vnr']; $x++){ 
              ?&gt;
  
              &lt;td&gt;&lt;img alt="" class="yellow-process center-block " id ="cut-full-roll-&lt;?php echo $row['id_vnr']; ?&gt;" name="&lt;?php echo $row['id_vnr']; ?&gt;" src="../../css/icons/vinyl-rolls/cut.png"&gt;&lt;/td&gt;
          &lt;?php
          }
          ?&gt;
  
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  </code></pre>
  
  <p>My jquery selector
  If I can give each element different ID, than I can do something like this to add clicked event to clicked image. </p>
  
  <pre><code>jQuery( "#vinyl-roll-down-&lt;?php echo $row['id_vnr']; ?&gt;" ).click(function() {
  </code></pre>
  
  <p>But I need help assign different unique to each element in far loop. </p>
  
  <p>Thanks in advance. </p>