 <p>Yet another solution:</p> <pre><code>&lt;lable&gt;Set1&lt;/lable&gt; &lt;input type="checkbox" name="set_199[]" value="Apple" /&gt; &lt;input type="checkbox" name="set_199[]" value="Mango" /&gt; &lt;input type="checkbox" name="set_199[]" value="Grape" /&gt; &lt;input type="button" value="check" class="js-submit"&gt; </code></pre> <p>Js:</p> <pre><code>$(".js-submit").on("click", function(){ var a = $("input[type='checkbox']:checked"); var values = {}; a.each(function(){ var value = $(this).val(); var name = $(this).attr("name"); if(!values[name]) values[name] = []; values[name].push(value) }); console.log(values) }); </code></pre> <p><a href="http://jsfiddle.net/6775b/" rel="nofollow">Demo</a></p>