document.getElementsByTagName("div")[0].innerHTML = "";
document.querySelector(".output").innerHTML = "";
let tal1 = parseInt(document.getElementById("tal1").value);
let tal2 = parseInt(document.getElementById("tal2").value);
let finalValue = 0;
while(tal1 < tal2 + 1){
if (tal1 * -1 > tal2) break;
let isNegativeOutput = (tal1 < 0) ? document.getElementsByTagName("div")[0].innerHTML += tal1 : document.getElementsByTagName("div")[0].innerHTML += "+" + tal1;
finalValue += tal1;
tal1 *= -1;
let isNegative = (tal1 < 0) ? tal1 -= 1 : tal1 += 1;
}
document.querySelector(".output").innerHTML = "= " + finalValue;