I have a problem that when I try to delete the li that I made in js, the following code will delete all the list not just the clicked li
and when choosing the parent the span does not work properly
function showdata() {
var newtodo = $("#newtodo").val();
$("ol").append('<li class"batodo" >' + newtodo + '<span class="deltodo">' +" x" + "</span>" + "</li>");
}
$(".deltodo").click(function() {
$(this).parents(".batodo").remove();
});