I'm trying to build a preview of images, but I need each one to be independent, I'm facing a problem that I can not solve. I need to access id's dynamically with JQuery, can anyone give a light?
Code below for review:
<div id="container_principal">
<div class="box_principal">
<div id="enviado_por">Enviador por: Usuario 1</div>
<div id="img_foto_1"></div>
<div id="img_foto_2"></div>
<div id="img_foto_3"></div>
<div id="btn_abrir_descricao">Ver Descrição</div>
<div id="descricao">fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds aaa</div>
</div>
<div class="box_principal">
<div id="enviado_por">Enviador por: Usuario 2</div>
<div id="img_foto_1"></div>
<div id="img_foto_2"></div>
<div id="img_foto_3"></div>
<div id="btn_abrir_descricao">Ver Descrição</div>
<div id="descricao">fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds fddsfdsdsffds aaa</div>
</div>
</div>
In this case it would be several images and in jquery I needed to make each one unique and that I could access them through the id:
For example I have the id "description", in jquery would have the click of the button description and when it was open, it would have to open independent of the other box, I do not know to explain kkkkk right, but I would like to generate dynamically and to be able to access every an independent one in jquery. How do I do that? could anyone help?