I'm trying to read the value from a textbox and it returns nothing.
Within the console, it simply shows a white line, with the line number of the console.log
statement.
var amount = document.getElementById("billAmt").value;
document.getElementById('calculate').addEventListener('click', function() {
console.log(amount);
});
<input id="billamt" type="text" placeholder="Bill Amount">
<button type="button" id="calculate">Calculate!</button>