javascript - Add class when Load content from external source -
given script load data specific div of external source on click. trying add div class when loading content image , text. mean when contents loads new classes auto added <div class="images"> img</div> , <div class="summery"> text text text</div> html: <button class='btn'/> <div id="load-here"></div> <!-- load here --> </body> script: $(function() { var page = null; var counter = 0; function getnext() { // grab next element array of date-outer divs , copy .content div if (counter >= page.length) return; var elm = $(page[counter]).clone(); elm.find('script').remove(); // remove script tags in div elm.appendto('#load-here'); counter++; } $('button.btn').click(function(e) { if (page === null) { page = false; // prevents request being made twice $.get(...