jquery How to access only checked checkbox?
<p>I have a div which contains <code>7 checkboxes</code> , i wrote this following code for accessing <code>only the checked checkbox</code> into the <code>array icons</code></p>

<pre><code>var icons = $("div").find("input[type=checkbox]").each(function () { 
if($(this).attr("checked") == "checked") return this; });

alert(icons.length);
</code></pre>

<p>but it always alert 7 .Can anybody tell me the problem?</p>
