title: Remove Row from table using jQuery
body: <p>I want to generate a table with content of the array with an option to delete the rows. I got a basic block of code that I think that should work but it's not doing anything and it's giving me "Uncaught SyntaxError: Unexpected token }" error.</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>function newtest2() {
    $(this).parents('tr').remove();
  }
  
  function newtest() {
    var name = ["Avengers", "Black Mirror", "Star Wars"];
    var r = name.length;
    $("#table1").empty();
    for (var i = 0; i &lt; r; i += 1) {
  
      $("#table1").append("&lt;tr&gt;&lt;td&gt;" + name[i] + "&lt;/td&gt;&lt;td&gt;" + "&lt;button onclick='newtest2(this)'&gt;Remove&lt;/button&gt;" + "&lt;/td&gt;&lt;/tr&gt;");
  
    }
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#table1 {
    background: gray;
  }
  
  td {
    border: 1px solid black;
    text-align: center;
    color: white;
    font-weight: bold;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;table id="table1"&gt;
  
  &lt;/table&gt;
  
  
  &lt;br&gt;
  &lt;button onclick="newtest()"&gt;TEST&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>