[jQuery] Is checkbox checked?

[jQuery] Is checkbox checked?

<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-16">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Trebuchet MS";
panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Trebuchet MS";
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</HEAD>
<BODY lang=EN-GB link=blue vlink=purple>
<DIV>
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0"><!-- Letter Heading -->
<TBODY>
<TR>
<TD><!-- Left margin -->
</TD>
<TD>
<div class=Section1>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>I think it’s;<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>$(“#mismatch”).checked = “checked”;<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font>
<div>
<table class=MsoNormalTable border=0 cellpadding=0>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><img width=30 height=33 id="_x0000_i1026"
src="cid:image001.gif@01C69932.9CE9A450"><o:p></o:p></span></font>
</td>
<td width=10 style='width:7.2pt;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>

<b><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";font-weight:bold'>Luc Pestille</span></font></b><font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>
Web Designer <o:p></o:p></span></font>



<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>e: luc.pestille@in2.co.uk
t: +44 (0)1628 899 700
f: +44 (0)1628 899 701 <o:p></o:p></span></font>



</td>
</tr>
</table>
</div>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Kevin Bosak
<b><span style='font-weight:bold'>Sent:</span></b> 26 June 2006 14:58
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">discuss@jquery.com</st1:PersonName>
<b><span style='font-weight:bold'>Subject:</span></b> [jQuery] Is checkbox
checked?</span></font><span lang=EN-US><o:p></o:p></span>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I'm having trouble trying to determine if a checkbox is checked or not
using JQuery syntax.  Here's the code:
    alert($("#mismatch").checked);
    alert($("#mismatch").val());
    alert(document.getElementById ('mismatch').checked);
The first line gives me 'undefined'.
The second gives me the correct value of the checkbox.
The third gives me the correct 'checked' value.
What is the correct JQuery syntax to tell if a checkbox is checked or not?
(and val() needs to be added to the docs, it took me forever to find that).<o:p></o:p></span></font>
</div>
</TD>
<TD><!-- Right margin -->
</TD>
</TR><!-- Disclaimer -->
<TR>
<TD COLSPAN="3"><BR>
<DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana" ALIGN="justify">In2<BR>Thames House<BR>Mere Park<BR>Dedmere Road<BR>Marlow<BR>Bucks<BR>SL7 1PB<BR><BR>Tel 01628 899700<BR>Fax 01628 899701<BR>e: <A HREF="mailto:sales@in2.co.uk">sales@in2.co.uk</A><BR>i: <A HREF="http://www.in2.co.uk/">www.in2.co.uk</A><BR><BR><FONT COLOR="silver">This message (and any associated files) is intended only for the use of discuss@jquery.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not discuss@jquery.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author Luc.Pestille@in2.co.uk and do not necessarily represent those of the company. <BR><BR></FONT>
</DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/