 <p>Assuming that your HTML resembles the following:</p> <pre><code>&lt;input name="demo" type="checkbox" checked value="1" /&gt; &lt;input name="demo" type="checkbox" value="2" /&gt; &lt;input name="demo" type="checkbox" checked value="3" /&gt; </code></pre> <p>Then simply retrieve the elements of the relevant name, then iterate through the collection/nodeList and add the values to a declared 'total' variable:</p> <pre><code>var boxes = document.getElementsByName('demo'), total = 0; for (var i = 0, len = boxes.length; i &lt; len; i++){ if (boxes[i].checked &amp;&amp; boxes[i].type.toLowerCase() == 'checkbox') { total += parseInt(boxes[i].value, 10); } } console.log(total); </code></pre> <p><a href="http://jsfiddle.net/davidThomas/YtArx/" rel="nofollow">JS Fiddle demo</a>.</p> <p>the above code is, I think, cross browser compatible; but if you're looking for a more up-to-date technique that simplifies the <code>for</code> loop (to omit the <code>if</code> checks), then you can use <code>document.querySelectorAll()</code> as the selector technique:</p> <pre><code>var boxes = document.querySelectorAll('input[name="demo"][type="checkbox"]:checked'), total = 0; for (var i = 0, len = boxes.length; i &lt; len; i++){ total += parseInt(boxes[i].value, 10); } console.log(total); </code></pre> <p><a href="http://jsfiddle.net/davidThomas/YtArx/1/" rel="nofollow">JS Fiddle demo</a>.</p> <p>References:</p> <ul> <li><a href="https://developer.mozilla.org/en-US/docs/DOM/document.getElementsByName" rel="nofollow"><code>document.getElementsByName()</code></a>.</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.querySelectorAll?redirectlocale=en-US&amp;redirectslug=DOM%2FDocument.querySelectorAll" rel="nofollow"><code>document.querySelectorAll()</code></a>.</li> <li><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLowerCase" rel="nofollow"><code>String.toLowerCase()</code></a></li> <li><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt" rel="nofollow"><code>parseInt()</code></a></li> </ul>