title: Adding information to the modal window
body: <p>On the page I form a table from an array. By double click to the row of this table, a modal window with the input should appear, in which there is information about this same line for editing it. I do not know how to add this information to the modal window.</p>
  
  <pre><code>table = document.createElement('table');
  table.style.border = '1px solid black';
  table.style.borderRadius = '5px';
  table.style.margin = '0 auto';
  for (i = 0; i &lt; info.length; i++) {
       row = document.createElement('tr');
       row.className = 'dbl';
       row.id = i;
       for (j = 0; j &lt; info[i].length; j++) {
          cell = document.createElement('td');
          cell.appendChild(document.createTextNode(info[i][j]));
          cell.style.borderBottom = '1px solid #ddd';
          cell.style.padding = '4px';
          cell.style.width = '130px';
          row.appendChild(cell);
       }
    table.appendChild(row);
    }
    document.body.appendChild(table);
  
   for (i=1;i &lt; info.length; i++) {
        document.getElementById("" + i).addEventListener("dblclick", zxc);
  
       function zxc() {
            var modal = document.getElementById('myModal');
            var span = document.getElementsByClassName("close")[0];
            modal.style.display = "block";
            span.onclick = function () {
                 modal.style.display = "none";
            }
            window.onclick = function (event) {
            if (event.target == modal) {
                  modal.style.display = "none";
            }
        }
       document.getElementById('client').value = info[i][0];
       document.getElementById('date').value = info[i][1];
       document.getElementById('sum').value = info[i][2];
       document.getElementById('val').value = info[i][3];
      }
      }
  </code></pre>
  
  <p>html code</p>
  
  <pre><code>   &lt;div id="myModal" class="modal"&gt;
          &lt;div class="modal-content"&gt;
              &lt;span class="close"&gt;&lt;button&gt;&amp;times;&lt;/button&gt;&lt;/span&gt;
              &lt;form method="post"&gt;
                  &lt;p&gt;Заемщик: &lt;input type="text" id="client" name="client" value=""&gt;&lt;/p&gt;
                  &lt;p&gt;Дата выдачи: &lt;input type="text" id="date" name="date" value=""&gt;&lt;/p&gt;
                  &lt;p&gt;Сумма кредита: &lt;input type="text" id="sum" name="sum" value=""&gt;&lt;/p&gt;
                  &lt;p&gt;Валюта кредита: &lt;input type="text" id="val" name="val" value=""&gt;&lt;/p&gt;
                  &lt;button&gt;Сохранить&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>