Find and read all checked checkboxes and push their names in an array
<p>I have multiple checkBoxes on my page and using javascript I want to find all <strong>checked boxes</strong> and push their repective names in an array as follows:</p>

<pre><code>    var Names = new Array();
 $.each($(':checked'), function (key, value) {
 Name.push($(value).attr("name"));
 }); 
</code></pre>

<p>What is wrong with the above code?</p>
