Can i append an already existing div to another already existing div?
Check this jsFiddle for a quick POC. Apparently it does.
The trick is to pass the object reference, not just the object id, like so:
$('#menu_form').on('click', function(){
$('#form_div').append($('#display_div'));
});
You could also pass the current object, using this
:
$('#menu_form').on('click', function(){
$('#form_div').append(this);
});
Using .appendTo()
$('#menu_form').on('click', function(){
$('#form_div').appendTo('#display_div'); // appendTo -> selector
});
Using .append()
$('#menu_form').on('click', function(){
$('#display_div').append( $('#form_div') ); // append -> object
});