+ 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(); }); });
1 Respuesta
+ 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