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
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
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
3 matches
Mail list logo