Skip to content
Advertisement

Create multiple modals in a loop while passing data

I am trying to make a display while looping through items and displaying buttons. The buttons can open modals that display some data. I have tried to pass the data to the modal but it is just displaying the first iteration of the loops information and never get’s updated. What do I need to do to make a modal for each iteration of my list?

JavaScript

Advertisement

Answer

Try this, add a unique #id to each modal window:

JavaScript

Hope it helps.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement