Hi everyone!
I am trying to get the value of an input box for further computation…
I have on my html:
<div class="form-amount">
<form action="">
<label for="input">Enter amount</label>
<input type="number" id="amount">
</form>
</div>
and in my javascript:
let amount = Number(document.getElementById('amount').value);
console.log(amount)
But the value I am getting in the console.log is 0(zero) when I insert a number on my input box.
Any ideas what I am doing wrong?