views:

75

answers:

1

I am trying to check and uncheck an <input type="checkbox" /> by adding and removing the checked="checked" attribute using javascript (jQuery). It works great in Firefox & IE. Adding and removing disabled="disabled" works perfectly. But with checked, neither clearing nor adding the attribute does anything.

I'm writing in XHTML 1.0 Strict--I tried switching everything around to HTML 4.1 and just using checked with no equals sign or value, and it still didn't work.

I'm working on Eclipse with the BlackBerry 9000 Simulator 4.6.0.200904091609-212.

Any ideas? A bug? Thanks.

+1  A: 

Have you tried setting the DOM object's checked property to false, the old-fashioned way?

Tomalak
sounds promising. A few searches and I'm not sure exactly how to do this--could you suggest a way either with jQuery or plain old javascript? thanks.
carillonator
There was a time when you could control the DOM *without* jQuery. These things still work. ;-) http://www.web-source.net/web_development/controlling_checkboxes.htm
Tomalak
it worked, thanks!
carillonator
Good to hear. :)
Tomalak