Sumar valores numéricos de varios input text

PHOTO EMBED

Tue Nov 29 2022 15:23:12 GMT+0000 (Coordinated Universal Time)

Saved by @modesto59 #html

/* sum the numeric values of 4 input text */
var sum = 0;
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
  sum += parseInt(inputs[i].value);
}
alert(sum)
content_copyCOPY