Hi,
With the code below I can add the static contents of two text boxes:
var y = $w("#text17").text;
var z = $w("#text19").text;
var x = +y + +z ;
console.log("Y is", y, "Z is", z, "and Xsum is", x)
$w("#answer").text = String(x);
These two text boxes though have dynamic numerical values. How can I change the code above not to add the static content of the text boxes but the actual numbers loaded dynamically every time?
Thanks.
@russian-dima ? maybe?
Are you trying to add (addition) the two number??
If it is ->
var y = $w("#text17").text; var z = $w("#text19").text; var x = Number(y) + Number(z); console.log("Y is", y, "Z is", z, "and Xsum is", x) $w("#answer").text = String(x);
https://www.w3schools.com/jsref/jsref_number.asp#:~:text=The%20Number()%20function%20converts,midnight%20January%201%2C%201970%20UTC.