jquery ajax load certain div

If the div is part of the AJAX response:

$.ajax({
    url: 'test.html',
    dataType: 'html',
    success: function(html) {
        var div = $('#sourceDiv', $(html)).addClass('done');
        $('#targetDiv').html(div);
    }
});

Leave a Comment