title: Add a checkbox within a checkbox
body: <p>I'm creating a todo list and am trying to create a delete button.  I'm going to make the delete button a checkbox, but I'm not sure how to add it to my task.</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>$(() =&gt; {
    $('input').on('keypress', function(e) {
      if (e.keyCode == 13) {
        const newTask = $(this).val();
        if (newTask) {
          var li = $("&lt;li&gt;&lt;input type='checkbox' id='newtasklist' class='right-margin' &lt;label&gt;" + newTask + "&lt;/label&gt;&lt;/li&gt;");
          $('#tasksUL').append(li);
          $(this).val("");
        }
      }
    });
  
    $('body').on('click', ':checkbox', function(e) {
      $(this).parent().toggleClass('selected');
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.selected {
    text-decoration: line-through;
    font-size: 20px;
  }
  
  .right-margin {
    margin-right: 30px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;input type="text" name="newtask" value="" spellcheck="false" placeholder="New Task" id="newtask"&gt;
  &lt;ul id="tasksUL"&gt;
    &lt;li&gt;&lt;input type="checkbox" id="newtaskitem" class="right-margin"&gt;&lt;label&gt;test&lt;/label&gt;&lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>