Ad

How Can I Duplicate Html Div While Foreach JSON Array

- 1 answer

I have a Json Array with five Json Objects and they have title, description, date attributes.

And all the Information should display in a thumbnail I have created one thumbnail layout in HTML.

How can i duplicate the Thumbnails while i foreaching the five Json Array?

I just can use JavaScript or JQuery for my work and i need the same funcionalty like angular *ngFor

I hope someone can help me

Ad

Answer

Use jQuery's .clone() to duplicate the thumbnail container, do your json data stuff and then use .append()

Ad
source: stackoverflow.com
Ad