You can't put a checkbox in a checkbox, it doesn't really make sense. How would the browser know what to act upon.
To solve your problem, I've added an additional checkbox which is hidden by CSS, the label for it used to toggle the check box.
Then we use jQuery to find the items with the delete check box checked and remove the parent li
$(() => {
let idx = 0;
$('input').on('keypress', function(e) {
if (e.keyCode == 13) {
const newTask = $(this).val();
if (newTask) {
//Use a template literal, it makes replacing things easier. Use a counter
//to make sure id's are uniqe
idx++;
var li = $(`<li><input type='checkbox' id='newtasklist${idx}' name="done" class='right-margin'><input type='checkbox' id='delete${idx}' name="delete" value="newtaskitem${idx}"><label>${newTask}</label><label class="delete" title="Select item for removal" for='delete${idx}'>♻</label></li>`);
$('#tasksUL').append(li);
}
}
});
$("#deleteItems").on("click", function(){
//find checked delete checkboxes and iterate them
$("#tasksUL [name=delete]:checked").each(function(){
//find the parent list item and remove it
$(this).closest("li").remove();
})
})
});
/*We can do the decoration with CSS*/
#tasksUL input[name=done]:checked~label {
text-decoration: line-through;
font-size: 20px;
}
.right-margin {
margin-right: 30px;
}
/*Hide the delete check box - use the label instead*/
[type="checkbox"][name="delete"] {display:none;}
.delete {margin-left:1em;}
/*Change the appearence when marked for deletion*/
#tasksUL input[name=delete]:checked ~ label {color:#ccc; font-weight:bold}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
<input type="text" name="newtask" value="" spellcheck="false" placeholder="New Task" id="newtask">
<ul id="tasksUL">
<li>
<input type="checkbox" id="newtaskitem0" name="done" class="right-margin">
<input type='checkbox' id='delete${idx}' name="delete" value="newtaskitem0"><label>test</label><label for='delete${idx}' class="delete" title="Select item for removal">♻</label></li>
</ul>
<input type="button" value="Delete marked items" id="deleteItems">