Why does *[checked] act like :checked when using jQuery's filter method?
<p>Following on from a <a href="http://stackoverflow.com/questions/8673201/why-does-checked-not-match-a-single-checked-input-box">previous question</a>.<br>
Lets say I have two checkboxes on a page loaded with jQuery 1.5.2</p>

<pre><code>&lt;input id="test1" type="checkbox"/&gt;
&lt;input id="test2" type="checkbox"/&gt;
</code></pre>

<p>Then lets click both of them to give each the <code>checked</code> property.
Now lets grab all checkboxes and filter out the ones that aren't checked</p>

<pre><code>var numOfCheckedBoxes = $("input:checkbox").filter("*[checked]").size();
</code></pre>

<p>Now based on the answer to the <a href="http://stackoverflow.com/questions/8673201/why-does-checked-not-match-a-single-checked-input-box">previous question</a>, I would expect <code>numOfCheckedBoxes</code> to equal <code>0</code> but it equals <code>2</code>. I now I should just use <code>$("input:checkbox:checked")</code> or <code>$("input:checkbox").filter(":checked")</code>.</p>

<p>This differs from if I do</p>

<pre><code>var numOfCheckedBoxes = $("#test1").filter("*[checked]").size();
</code></pre>

<p>which sets <code>numOfCheckedBoxes</code> equal to <code>0</code>.<br>
Here is a jsFiddle of the <a href="http://jsfiddle.net/2QZvU/9/" rel="nofollow">first scenario in question</a>.
Here is a jsFiddle of the <a href="http://jsfiddle.net/2QZvU/13/" rel="nofollow">second scenario in question</a>.</p>
