title: trying to copy an email address
body: <p>I would like to request some help in pointing out how to change a block of code.  The first block has a copy function in it that I would like to use in place of the &quot;delete&quot; check box ion the second block.  I need to change the &quot;delete&quot; check box to a &quot;copy&quot; check box to copy the email address only.  I need to paste the email address into an email and also a text box to keep track of the emails that have been sent rather than digging through the sent folder.</p>
  <pre><code>/**$(function() {
    $('.copy-to-clipboard input').click(function() {
      $(this).focus();
      $(this).select();
      document.execCommand('copy');
      $(&quot;.copied&quot;).text(&quot;Copied to clipboard&quot;).show().fadeOut(2500);
    });
  });**/
  
  $(function() {
    $('.copy-cell').click(function() {
      const other = $(this).next('td')
      other.find('input').focus();
      other.find('input').select();
      document.execCommand('copy');
      /*$(&quot;.copied&quot;).text(&quot;Copied to clipboard&quot;).show().fadeOut(2500);*/
    });
  });
  
  
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
  &lt;meta charset=&quot;utf-8&quot;&gt;
  &lt;title&gt;jQuery Add / Remove Table Rows Dynamically&lt;/title&gt;
  &lt;style&gt;
      form{
          margin: 20px 0;
      }
      form input, button{
          padding: 5px;
      }
      table{
          width: 100%;
          margin-bottom: 20px;
          border-collapse: collapse;
      }
      table, th, td{
          border: 1px solid #cdcdcd;
      }
      table th, table td{
          padding: 10px;
          text-align: left;
      }
  &lt;/style&gt;
  &lt;script src=&quot;https://code.jquery.com/jquery-3.5.1.min.js&quot;&gt;&lt;/script&gt;
  &lt;script&gt;
      $(document).ready(function(){
          $(&quot;.add-row&quot;).click(function(){
              var name = $(&quot;#name&quot;).val();
              var email = $(&quot;#email&quot;).val();
              var markup = &quot;&lt;tr&gt;&lt;td&gt;&lt;input type='checkbox' name='record'&gt;&lt;/td&gt;&lt;td&gt;&quot; + name + &quot;&lt;/td&gt;&lt;td&gt;&quot; + email + &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
              $(&quot;table tbody&quot;).append(markup);
          });
          
          // Find and remove selected table rows
          $(&quot;.delete-row&quot;).click(function(){
              $(&quot;table tbody&quot;).find('input[name=&quot;record&quot;]').each(function(){
                  if($(this).is(&quot;:checked&quot;)){
                      $(this).navigator.cilpboard.writeText();
                  }
              });
          });
      });    
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form&gt;
          &lt;input type=&quot;text&quot; id=&quot;name&quot; placeholder=&quot;Name&quot;&gt;
          &lt;input type=&quot;text&quot; id=&quot;email&quot; placeholder=&quot;Email Address&quot;&gt;
          &lt;input type=&quot;button&quot; class=&quot;add-row&quot; value=&quot;Add Row&quot;&gt;
      &lt;/form&gt;
      &lt;table&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Select&lt;/th&gt;
                  &lt;th&gt;Name&lt;/th&gt;
                  &lt;th&gt;Email&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;input type=&quot;checkbox&quot; name=&quot;record&quot;&gt;&lt;/td&gt;
                  &lt;td&gt;Peter Parker&lt;/td&gt;
                  &lt;td&gt;peterparker@mail.com&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;button type=&quot;button&quot; class=&quot;delete-row&quot;&gt;Delete Row&lt;/button&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>