<input id="tal1" type="text" placeholder="Tal 1">
<input id="tal2" type="text" placeholder="Tal 2">
<button type="button" onclick="inputAddition()">Addera alla tal fr.o.m Tal 1 till Tal 2</button>
<div></div>

<script>
function inputAddition(){
let tal1 = parseInt(document.getElementById("tal1").value);
let tal2 = parseInt(document.getElementById("tal2").value);
let finalValue = 0;

while(tal1 < tal2 + 1){
finalValue += tal1;
tal1++;
} document.querySelector("div").innerHTML = finalValue;
}
</script>