+ 2

To-Do List

Why this code is not working? Pls explain it :/ $(function() { $("#add").on("click", function() { let inputVal = $("input").val(); if (inputVal !== '') { let elem = $("<li></li>").text(inputVal); $("input").val(""); $("#mylist").append(elem); $(elem).append("<button class='rem'>X</button>"); } }); $(".rem").on("click", function() { $(this).parent().remove(); }); });

25th Feb 2018, 2:38 PM
Misak Poghosyan
Misak Poghosyan - avatar
1 Antwort
+ 6
It's difficult for us to identify the bug or problem in your code here.So go to Code Playground and create a new code and give us the link..That will make it easier for us to solve your problem
25th Feb 2018, 4:04 PM
Md. Nafis Ul Haque Shifat
Md. Nafis Ul Haque Shifat - avatar