Another way to add an element and bind an event without delegation:
$("#add").click(function(event){ $("<a />", { "class": "remove", href: "#", text: "x" }).on("click", function() { alert("123"); return false; }).appendTo("#list"); return false; });
Avoid using the live method as it is deprecated and permanently deleted in the latest version of jQuery.
source share