I search more times but not get any idea,
Here is HTML:
{% for pr in productlist %}
<div class="grid-container">
<span>
<label> {{ pr.productname }} </label>
<label name="mylist" class="prprice" id="prprice"> {{ pr.price1 }} </label>
</span>
<section class="sec">
<input type="number" name="mylist" class="prnumber" id="prnumber">
</section>
</div>
{% endfor %}
I can get price (id : prprice) one by one in loop via : price = parseFloat($(this).parents('span').find('label:eq(1)').text());
It is my full jQuery also :
$(document).ready(function()
{
$("#tabSum").click(function(){
var price = 0;
var number = 0;
$(".grid-container").each(function() {
price = parseFloat($(this).parents('span').find('label:eq(1)').text());
number = parseFloat($('.sec').find("input[name='mylist']").val()); <-- problem
});
});
My problem is that i want get all number (id : prnumber) elements one by one (like price) but it returned first element only, what is wrong here?