How can I add a modal for each image of my gallery?

I was wondering how can I have a modal for each image when I click the images.
I have been doing it pretty easily using images inside divs and displaying them from my html file but now that I manage to create the images from the javascript file I can’t find a simple way to add modals to each image.

javascript code:

It sounds like you want each image to pop-up in a modal dialog when clicked on? If so, you could use the dialog element, although it is still not 100% accessible without a little work. Because of that, I would recommend you use a11y-dialog.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.