title: how to make an undo button for a dynamically made checkbox list
body: <p>I populate the page using javascript/jquery and html, it adds a check box when you hit add, i was just wondering a way to add an undo button to delete the last checkbox made.</p>
  
  <p>heres the js fiddle for what i have</p>
  
  <p><a href="https://jsfiddle.net/kf2mq20e/" rel="nofollow">My code JSFIDDLE</a></p>
  
  <p>code snippet:</p>
  
  <pre><code>     $(document).ready(function() {
  $('#btnSave').click(function() {
      addCheckbox($('#txtName').val());
       txtName.value="";
      });
   });
  
    function addCheckbox(name) {
      var container = $('#cblist');
      var inputs = container.find('input');
      var id = inputs.length+1;
  
      $('&lt;input /&gt;', { type: 'checkbox', id: 'cb'+id, value: name }).appendTo(container);
      $('&lt;label /&gt;', { 'for': 'cb'+id, text: name }).appendTo(container);
      $('&lt;br/&gt;').appendTo(container);
      //dino
     }
  </code></pre>