How to append or add html code to a draggable element in the drop area in Jquery
<p>I'm having a normal html section where I'm dropping some html code. I need them to append after the class <code>.page-content-wrapper</code> if there is no item and if there is item I want to append the html code below the very last element and each element is sortable. I'm getting the html code to be appended through ajax in JSON format, while taking it to console.log I get:</p>

<pre><code>Object {htmlcode: "&lt;div&gt;//html code....&lt;/div&gt;"}
</code></pre>

<p>I want to append to the div with class <code>.page-content-wrapper</code>. Following is my JQuery:</p>

<pre><code>var origin= 'sortable';
var nitsbuilder = {
    nits_id: $('[data-nitsid]'),
    editarea: $('.page-content-wrapper')
};

nitsbuilder.dropeventhandler = function ($item) {
    var nits_id = $item.data('nitsid');
    $.ajax({
        method: 'POST',
        url: dropurl,
        data: { nits_id: nits_id, _token: token},
        dataType: 'json',
        success: function (data) {
            console.log(data);
            nitsbuilder.editarea.html(data);
        }
    });
}

nitsbuilder.init = function () {
    var navmenu= $('ul.nitseditormenu').find('li').find('ul').find('li');
    navmenu.draggable({
        connectToSortable: "nitsbuilder.editarea",
        helper: "clone",
        cursor: "move",
        start: function () {
            origin = 'draggable';
        }
    });

    nitsbuilder.editarea.droppable({
       drop: function (event, ui) {
                nitsbuilder.dropeventhandler(ui.draggable);
       }
    }).sortable({
        revert: true
    });
}();
</code></pre>