Here is the code in full:
<form method="post" action="">
<input type="number" name="number" id="number" placeholder="0" />
<input type="button" name="Add" value="Add 1.5%" onclick="willsCalc()" />
var userinput = document.getElementById("number").value;
var percentage = Number(userinput) * (1.5/100);
var sum = Number(userinput) + Number(percentage);
document.getElementById("answer").innerHTML = "<strong>Answer:</strong> " + sum;
When the form is submitted on-click, the JS function runs (willsCalc). We get the user submitted number back from the form as a variable and then use a couple of other variables to make the calculation. The final step is to write the calculation back out into the page, to display to the sum.
So working on the assumption a user types 22 in the box and hits the submit button, their answer will be shown as 22.33.
22 + 1.5% = 22.33