On Sun, 19 Sep 2004 19:56:12 GMT, Richard Trahan <>
wrote:
> This code doesn't work:
>
> document.getElementById("myid").style.backgroundCo lor = "#abcdef"
When are you executing that code? If it's before the element, myid, has
been parsed you should get an error stating that myid couldn't be found.
If not, please show an example including HTML (preferably in a host web
page).
[snip]
> Also, I can't find any mention of a class property in the DOM; IOW,
> document.getElementById("myid").class always crashes, yet class works in
> the <input> tag. Is it not possible to dynamically change the class of
> an element?
It is possible. You set the class using the className property. The DOM
HTML Specification briefly mentions why this name change took place.
Good luck,
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
|