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

Hassan Schroeder hassan at webtuitive.com
Sat Apr 12 09:58:24 CDT 2008


Paul Novitski wrote:

> Yeah, checked isn't a native DOM element property.  Use setAttribute.
> http://developer.mozilla.org/en/docs/DOM:element#Properties
> http://developer.mozilla.org/en/docs/DOM:element.setAttribute

Has this changed with IE7?

I ask because I went through no end of grief with either IE 5.x or
IE 6 not properly handling setAttribute, and it seemed that (at the
time) the prevailing consensus was that setting attributes directly
e.g. `foo.checked = true` was more cross-browser reliable.

But it was definitely several years ago...

-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

                           dream.  code.



More information about the Javascript mailing list