I have an HTML code, where it has a link in an image. This link is created by a control panel and you can not put a ID
or a Classe
in it. But the image with the link is inside a div
that has ID
com name popup-imagem
.
I would like to know if it is possible to add data-popup-open="popup-1"
within the link through 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 would like you to stay:
<div id="popup-imagem">
<a href="#" data-popup-open="popup-1"><img src="imagem.jpg">
</a>
</div>