jQuery checkbox问题

如何判断是否已经打勾?

多选框checkbox: $("#chk1").attr("checked",'');//不打勾
$("#chk2").attr("checked",true);//打勾
if($("#chk1").attr('checked')==undefined) //判断是否已经打勾

$("#c").attr("checked")

[code="html"]



<br> function test(){<br> alert($(&quot;#c&quot;).attr(&quot;checked&quot;));<br> }</p> <pre><code> &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type=&quot;checkbox&quot; id=&quot;c&quot;&gt; &lt;input type=&quot;button&quot; value=&quot;ok&quot; onclick=&quot;test()&quot;&gt; &lt;/body&gt; </code></pre> <p></html><br> [/code]</p>