I need a clarification regarding "Clone" method in jQuery. I have written the following.
$("p").on("click",function(){
console.log("Paragraph clicked");
});
$("#p3").on("click",function(){
console.log("Paragraph 3 clicked");
});
//Cloned all paragraph elements and keeping all event handlers
var $paras=$("p").clone(true);
//Changed the duplicate id to new value
$paras.eq(2).attr("id","Dp3");
$("body").append($paras);