title: jquery how to remove both the <tr> tag on click?
body: <p>I have a <code>checkbox</code> which has <code>id</code> - when I select the <code>checkbox</code>-es and click the <code>button</code>, the <code>tr</code> tag should get removed; when I select the multiple <code>checkbox</code>-es both <code>tr</code> tag should get removed, but the thing is when I select the multiple <code>checkbox</code>-es only the <code>tr</code> tag belong to the 1st <code>id</code> get removed. </p>
  
  <p>I have tried the following code</p>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>&lt;script&gt;
      function getsample(val) {
          $(function () {
              checkboxid = $('input[name="chk"]:checked').map(function () {
                  return this.id
              }).get();
          });
          $("#" + checkboxid).closest('tr').remove();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;table&gt;
          &lt;tbody&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;UserName&lt;/th&gt;
                  &lt;th&gt;Role&lt;/th&gt;
                  &lt;th&gt;Department&lt;/th&gt;
                  &lt;th&gt;Semester&lt;/th&gt;
                  &lt;th&gt;Email&lt;/th&gt;
                  &lt;th&gt;Action&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td&gt;student15&lt;/td&gt;
                  &lt;td&gt;Student&lt;/td&gt;
                  &lt;td&gt;CS&lt;/td&gt;
                  &lt;td&gt;2&lt;/td&gt;
                  &lt;td&gt;arung@gmail.com&lt;/td&gt;
                  &lt;td&gt;&lt;input name="chk" type="checkbox" id="sam1"&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;student16&lt;/td&gt;
                  &lt;td&gt;Student&lt;/td&gt;
                  &lt;td&gt;CS&lt;/td&gt;
                  &lt;td&gt;2&lt;/td&gt;
                  &lt;td&gt;arung@gmail.com&lt;/td&gt;
                  &lt;td&gt;&lt;input name="chk" type="checkbox" id="sam2"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;input type="button" onclick="getsample()" id="button" value="Submit"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I use  <code>$("#"+this.id).closest('tr').remove();</code> inside the map function all the selected <code>tr</code> tag get removed, but I need to call <code>checkbox</code> <code>id</code> outside the map function.</p>
  
  <p>Help me, thanks in advance.</p>