I would like to know how I can get the hidden input IDs that were generated dynamically within the DIV via Jquery.
I have tried the following but it does not work:
$(document).on('click', '.div_desc_prod', function() {
alert($(".id_produto").val());
});
Where .div_desc_prod is referenced for each dynamically generated div, and .id_product refers to each input generated within each div dynamically.
I think I could not express my case well ... I do not need to generate the DIVs with dynamic ID's, the DIV's are generated from a selection in the Menu, for example, when selecting in the Menu the Traditional Pizzas Category, will be generated on the screen the amount of DIV with each Pizza within that category in each DIV, and in each DIV already has an input hidden with the ID of each pizza listed. So I need to select the desired pizza ID by clicking on the DIV to play in the shopping cart.
Not only 1 ID, there may be 1 or more, for example:
<div class="div_desc_prod" id="div_desc_produto">
<input type="hidden" name="id_produto" value="'+ obj.id +'">
</div>
This div can be generated 1 or several times with different IDs, so when I click on a certain DIV I want to get the ID of the one being clicked.