Good day
I am trying to get a total of two numbers.
The first number I need to get form my page (the number changes every few seconds (crypto clicker)
Second number must be 35
This is the code I got after search, but do not know how to get itto work
`<form>
USD:<input type="text" name="num1"><br>
Doge:<input type="text" name="num2"><br>
Sum: <input type="text" name="sum"><br>
<input type="button" value="Sum" onclick="calcSum()">
</form>
<script>
function calcSum() {
let num1 = document.getElementsByName("num1")[0].value;
let num2 = document.getElementsByName("num2")[0].value;
let sum = Number(num1) * Number(num2);
document.getElementsByName("sum")[0].value = sum;
}
</script>`