<div class="sum">5</div>
<div class="sum">7</div>
<div class="sum">3</div>
<div class="sum">9</div>
<div class="sum">1</div>
<div class="result"></div>
document.querySelector('.result').innerText =
[...document.querySelectorAll('.sum')].reduce((acc, n) => acc + +n.innerText, 0);