0
I’m trying to put together an image preview, but I need each one to be independent, I’m facing a problem that I can’t solve. I need to access id’s dynamically with Jquery, someone can give a light?
Code below for analysis:
<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>
Then there would be several images and in jquery I needed to make each one unique and that I could access them by id:
There for example I have there the id "description", in jquery I would have the button click description and when I opened, I would have to open independent of the other boxes, I do not know explain right kkk, but I would like to generate dynamically and be able to access each independent in jquery. How do I do that? Someone could help?
How are you generating this HTML?
– Sergio