1
I have an HTML code, where it has a link in an image. This link is created by a control panel and it is not possible to place a ID
or a Classe
in it. But the image with the link is inside a div
who has the ID
by name popup-imagem
.
I wonder if it is possible to add data-popup-open="popup-1"
within the link via jQuery
, and if possible, how do I do this?
Current Code:
<div id="popup-imagem">
<a href="#"><img src="imagem.jpg">
</a>
</div>
How I’d like you to stay:
<div id="popup-imagem">
<a href="#" data-popup-open="popup-1"><img src="imagem.jpg">
</a>
</div>