title: Remove elements onclick (including the remove button itself) with jQuery
body: <p>I know there are some questions up which look like mine, but in this case I want the remove button to be removed as well and I don't know how I can do this.</p>
  <p>Here is my question:</p>
  <p>I append 3 elements with jQuery when an append button is clicked.
  Including a remove button.</p>
  <p>I want this remove button to remove it self and the other two elements.
  The counter should make identical Id's, but i'm not sure if i did this right way with jQuery.</p>
  <p>How can i delete three elements including the remove button onclick?</p>
  <pre class="lang-js prettyprint-override"><code>$(function() {
      var counter = 0;
      
      $('a').click(function() {
          $('#box').append('&lt;input type=&quot;checkbox&quot; id=&quot;checkbox&quot; + (counter) + &quot;/&gt;');
          $('#box').append('&lt;input type=&quot;text&quot; id=&quot;t1&quot; + (counter) + &quot;/&gt;');
          $('#box').append('&lt;input type=&quot;button&quot; value=&quot;.&quot; id=&quot;removebtn&quot; + (counter) + &quot;/&gt;');
          $(&quot;#box&quot;).append(&quot;&lt;br /&gt;&quot;);
          $(&quot;#box&quot;).append(&quot;&lt;br /&gt;&quot;);
          counter++;
      });
           
      $('removebtn').click(function() {
          remove(&quot;checkbox&quot;);
      });
  });
  </code></pre>