I'm trying to create a little program to calculate the income with a tax, but i've got a problem. Instead of sum the 2 numbers, it aggregate them
Here the example:
Price = 100
Rate = 0.05
Tax = Price * Rate -> 100 * 0.05 = 5
Income = Price + Tax = 100 + 5 = 105 (but the result I obtain is 1005)
I want to specify that the Price is get from a input.
Here the code
<input id="price" type="number" onchange="income()">
let price = document.getElementById("price").value;
let rate = 0.05;
let tax = price * rate;
let income = price + tax;
document.getElementById("result").innerHTML ="The income is: " + income;
How can i fix it?