function getRadioGroupValue(radioGroupObj) { var val = 0; for (var i=0; i < radioGroupObj.length; i++) if (radioGroupObj[i].checked){ val+=+radioGroupObj[i].value; } var total= 1000+val; document.getElementById("result").innerHTML=total; }