2
I cannot store input value in my variable. How should I proceed? My code below:
<input type="number" id="numero">
<input type="button" class="adicionar" value="Comprar" onclick="add()" />
<script>
function add(){
var quantidade = parseInt(document.getElementById('numero').value);
console.log("Value: "+quantidade);
</script>
I want to change the value of the input and my variable change also when I click the button.
It’s true, it worked. Thank you very much!
– Rennan