Project: Todo List
Add and remove items with delegation.
Example
$("#add").on("click", function () {
var t = $("#text").val().trim();
if (t) $("#list").append("<li>" + $("<i>").text(t).html() + "</li>");
$("#text").val("");
});
$("#list").on("click", "li", function () { $(this).remove(); });Exercise
Escape text.
$("<i>").text(t).()
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.