How do I make the same function for different actions?
I have a code like this https://codepen.io/lanimya/pen/BazaeWZ
Different code opens and closes modals.
I wanted to combine it into a function and substitute it, but I get an error on line 25.
I don't know how to fix it.
Line 19 each - working code.
Lana , I didn't understand what kind of data-img you have, so I replaced the markup, believing that this is also a modal:
To place the code, please use CodePen or similar tool. Thanks you!