[Javascript] IE work-a-round question (re: checkboxes)

David Hucklesby davidh126 at writeme.com
Fri Apr 11 17:48:19 CDT 2008


On Fri, 11 Apr 2008 16:56:38 -0400, tedd wrote:
> Hi gang:
>
> I wrote the following application and it works fine on most browsers except for IE's.
>
> http://webbytedd.com/quarters
>
> It seems that IE js doesn't understand the following statement:
>
> document.getElementById(id).checked = true;
>
[...]
>
> All the code has to do is to set a simple checkbox to 'on' in IE.
>

Hi Tedd,
This seems to work cross-browser this end (Win xp pro; IE7 and
"standalone" IE 5.5 and 6, as well as other browsers:

  document.getElementById(id).setAttribute('checked', true);


Cordially,
David
--




More information about the Javascript mailing list