algo asi?
Código HTML:
Ver original<div><input type="button" onclick="sumar()" value="sumar!"></div> <script type="text/javascript">
function sumar(){
var elementos = document.getElementsByName("sumar");
var total = 0;
for(i = 0; i <= elementos.length; i++){
if(typeof elementos[i] != 'undefined')
total += parseInt(elementos[i].value);
}
alert('suma total: ' + total);
}