title: Delete tr using jquery
body: <p>I have created a table and want to remove the rows with jquery.</p>
  
  <p>I have looked everywhere and I cannot work out what I have done wrong.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function () {
      $("#ao-referrer-summary").on('click', '.btnDelete', function () {
          $(this).closest('tr').remove();
      });
  });
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table id="ao-referrer-summary"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Referrer First Name&lt;/th&gt;
              &lt;th&gt;Referrer Last Name&lt;/th&gt;
              &lt;th&gt;Delete User&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;%%FNAME%%&lt;/td&gt;
              &lt;td&gt;%%LNAME%%&lt;/td&gt;
              &lt;td&gt;
                  &lt;button class="btnDelete"&gt;&amp;times;&lt;/button&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;%%FNAME%%&lt;/td&gt;
              &lt;td&gt;%%LNAME%%&lt;/td&gt;
              &lt;td&gt;
                  &lt;button class="btnDelete"&gt;&amp;times;&lt;/button&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>js fiddle
  <a href="http://jsfiddle.net/designstreet1/4pvrtghu/" rel="nofollow">http://jsfiddle.net/designstreet1/4pvrtghu/</a></p>