Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove appended element jquery

$(document).ready(function () {
    $("#add").click(function () {
        var newToDo = $("#newToDo").val();
        if(newToDo.length > 0){
            var anotherToDo = $("<p>" + newToDo + "</p>");
            $("#toDoList").append(anotherToDo);
            $("#newToDo").val(" ");

            // later when you want to delete it
            anotherToDo.remove();
        }
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #appended #element #jquery
ADD COMMENT
Topic
Name
4+4 =