title: Modal window for several products
body: <p>I have a problem. I need to make a modal window for each product, but in the modal window, all products only display the last product. I tried to assign id identifiers, but then only the modal window of the first product works.</p>
  
  <p><img src="https://i.stack.imgur.com/YdEqe.jpg" alt="enter image description here"></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>window.onload = function() {
    $('.img-for-modal').click(function() {
      $('.modal').css('display', 'block');
  
    });
  
    $('.close').click(function() {
      $('.modal').css('display', 'none');
    });
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="products-wrap"&gt;
    &lt;table class="product"&gt;
      &lt;tr&gt;
        &lt;td class="img" rowspan="3"&gt;
          &lt;img class="img-for-modal" src="media/products-image/1.jpg"&gt;
          &lt;div class="modal"&gt;
            &lt;span class="close"&gt;&amp;times;&lt;/span&gt;
            &lt;img class="modal-img" src="media/products-image/1.jpg"&gt;
          &lt;/div&gt;
        &lt;/td&gt;
        &lt;td class="product-info"&gt;
          &lt;article&gt;Lorem Ipsum is simply dummy text of the printing V1.0&lt;/article&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="product-info"&gt;
          &lt;b&gt;Цена: &lt;/b&gt;200 руб.
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="product-delete"&gt;
          &lt;a href="#"&gt;Добавить в корзину&lt;/a&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>