I have a function where on button click I add columns, now what I want is on button click the column I am adding, I want that to append to another div in my case both button and appended data both are added in same div for now
Here is the code I am working on
var i = 1;
$(document).ready(function() {
$("button[id='columnadd']").click(function () {
// create the element
var domElement = $('<div id="shoppingCart' + i++ + '" class="shoppingCart"><h2 class="ui-widget-header">Add Menu Items Here</h2><aside class="ui-widget-content" id="droppable"><ol><li class="placeholder">Add your items here</li></ol></aside></div>');
$(this).after(domElement);
// at this point you have domElement in your page
//.appendTo("#columnhoder")
// make it droppable
domElement.find("ol").droppable({
accept: '.small_box li',
greedy: true,
drop: function (event, ui) {
alert(1);
makeItDroppableToo(event, ui, this);
//$(this).find(".placeholder").remove();
//$("<li></li>").text(ui.draggable.text()).appendTo(this);
}
});
});
i want this
var domElement = $('<div id="shoppingCart' + i++ + '" class="shoppingCart"><h2 class="ui-widget-header">Add Menu Items Here</h2><aside class="ui-widget-content" id="droppable"><ol><li class="placeholder">Add your items here</li></ol></aside></div>');
to append to this div
<div id="columnholder">div>
You can use appendTo: