Search code examples
javascriptjquerywebweb-deployment

How to make clone div enabled using jquery?


This is my form

I have been trying to enabled my coned div and disable parent div .

function AddGroup() {
var newgrouplist = $("#group-list-edit-1").clone();
number1 = number1 +1 ;
newgrouplist.attr("id", "group-list-edit-"+number1);
newgrouplist.find("#group_select_1").attr("id", "group_select_"+number1);
newgrouplist.find("#group_select_1").attr("class", "group_select_clone");
$('.group_select_clone1').attr("enabled", "true");  
newgrouplist.find("#del_div").attr("style","border: 1px solid;font-size: 16px;padding: 1px;");
newgrouplist.find("#del_div").attr("onclick","DelGroup('group-list-edit-"+number1+"');");
//append clone on the end

This is how i'm editing my clone. Is there anyone who can help me with my problem ?


Solution

  • You can use the .clone() method.