0
I have an input field that receives the amount of products
input type="number" class="form-control" min="0" max="5" id="pugQuant" placeholder="0" onclick="calculo();"
And another that shows the calculated total. [total * value]
input type="text" class="form-control" id="totalPug" name="" value="1500.00" disabled
I’m wanting to do the calculation with a function and show the value in the input but I don’t know how to modify with javascript. My function returns Nan.
function calculo(){
var pugQuant = document.getElementById("pugQuant").value;
document.getElementById("totalPug").value = 1500.00 * pugQuant.id;
}
Why are you using this . id in the pugQuant variable ?
– Gato de Schrödinger
Actually I saw on a website, but I pulled out and it worked
– leme
Way to go, buddy.
– Gato de Schrödinger