+ 3
you need to access element content, wich is text so you also need to convert it to number before doing maths: var sum = document.getElementById ("idsum").innerHTML = +p1.textContent + +p2.textContent; (implicite convertion with leading +)
26th Jan 2021, 7:13 AM
visph
visph - avatar