[jQuery] Re: working with checkboxes

2008-11-12 Thread Michael Geary
You could use: $('#test')[0].checked Your original attempt to use $('#test').checked didn't work because checked is a property of the DOM element, not the jQuery object. By using [0] you get the first (and in this case, only) DOM element in the jQuery object's array of elements. $('#test') is p

[jQuery] Re: working with checkboxes

2008-11-12 Thread George
Thanks, But I think that if (document.getElementById('test').checked ) {} would be better...performance wise and readability is better Is there problem with this approach? PS: Is there shorter syntaxes for document.getElementById('test')? Thanks George. On Nov 12, 1:25 pm, ripple <[EMAIL PROT

[jQuery] Re: working with checkboxes

2008-11-12 Thread ripple
try:   if ($("#test").is(":checked")) {}     --- On Wed, 11/12/08, George <[EMAIL PROTECTED]> wrote: From: George <[EMAIL PROTECTED]> Subject: [jQuery] working with checkboxes To: "jQuery (English)" Date: Wednesday, November 12, 2008, 1:11 PM I have a checkbox the $('#test').checked always re