Good day everyone.

Quite new to Javascript, I have a small problem I cant seem to solve.

The idea is, when I press my “calculate” button, it will do calculations that I have set down in my function. The values are taken from input text box. The initial value is set to for example “4”, when I change the values in my text box, I want my function to keep using those new values which I have in my textbox. When hitting the calculate button, it will always use the new value.

this.calculate.addEventListener(“click”, calculations.bind(this)); //calculate button

function calculations(){

document.getElementById(“inputtextbox”).value = “4”; //input box, initial value 4

if (inputtextbox !== 4) {

var value = Number(document.getElementById(“inputtextbox”).value); //new values to be used

}

//using the “value” variable to do some maths down the line

}

Thank you for your time