jamesson,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var form = document.querySelector("form"),
input = form.querySelectorAll("input"),
result = document.querySelector("#result");
function sum(out, el) {
return out + (+el.value || +el || 0)
}
form.addEventListener("submit", function(event) {
event.preventDefault();
var res = [].reduce.call(input, sum, 0);
for (; (res += "").length > 1;) res = res.split("").reduce(sum, 0);
result.innerHTML = res
})
});
</script>
</head>
<body>
<form>
<input id="a" value="1" type="text">
<input id="b" value="1" type="text">
<input id="c" value="1" type="text">
<input id="d" value="1" type="text">
<input id="f" value="1" type="text">
<input id="g" value="1" type="text">
<input id="h" value="1" type="text">
<input id="j" value="1" type="text">
<br>
<input value="Сложить" class="add" type="submit"></form>
<div id="result"></div>
</body>
</html>