1
I’m having a little problem in my jquery code, I wanted to make a sum in which I put the value in the input + the span value in a div and generate it in another span, but it does not show me results.
HTML
<div class="media-body">
<div class="menu-tittle">
</div>
<div class="quantity">
<form action="#">
<div class="pizza-add-sub">
<input type="text" class="qtdpedidos" />
</div>
</form>
</div>
<div class="pizza-price"> <span class="pizza">10.00</span>
</div>
Order Value: R$0.00
JQUERY
$("#somar").click(function(){
var total = 0;
var valor= $('.pizza').val());
$('.qtdpedidos').each(function(){
var valor = Number($(this).val());
if (!isNaN(valor)) total += valor;
});
total = total - desconto;
$(".resultado").html(total.toFixed(2));
});
Thank you in advance
I’m testing here https://jsfiddle.net/bx3c5trg/
Solved yes, thank you Aunts!! n
– Harakin