Javascript - Cannot assign the value of a textbox to a variable : I'm trying to read the value from a textbox and it returns nothing.
Javascript:

        var amount = document.getElementById("billAmt").value;
        document.getElementById('calculate').addEventListener('click', function() {
        console.log(amount); 
        
    });

HTML: 

    <input id="billamt" type="text" placeholder="Bill Amount">
    <button type="button" id="calculate">Calculate!</button>
On console it simply shows a white line, with the line number of the console.log statement.