javascript - How can I display a selected list of checkboxes as another list of checkboxes? -


i have 2 divs on page:

<div id="divone">    // list of checkboxes model </div> <input type="button" id="btnadd" value="add" />  <div id="divtwo">    // want show checkbox list user selected divone </div> 

how can display selected list of checkboxes list of checkboxes?

...just copy them other div.. $("#divtwo").html($("#divone").html());


if want checked stuff..

var checkboxes = []; $("#divone").find("input[type='checkbox']").each(function(){     if($(this).is(":checked"))         $("#divtwo").append($(this).clone()); }); 

Comments