[Error] backgroundColor : setting a property that has only a getter !
David BERCOT <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I've posted my question on the dev-tech-javascript list, but maybe it's
a DOM question ;-)
I use a jQuery TreeView where I'd like to change backgroundColor for
some elements...
So, I've written this code :
function refreshStriping () {
var collect_ul, fils, petits_fils, i, j, k;
// On récupère la collection de tous les 'ul'
collect_ul = document.getElementsByTagName("ul");
for (i=0;i<collect_ul.length;i++) {
fils = collect_ul[i].childNodes;
for (j=0;j<fils.length;j++) {
if (fils[j].tagName == "li") {
petits_fils = fils[j].childNodes;
for (k=0;k<petits_fils.length;k++) {
if (petits_fils[k].tagName = "span") {
petits_fils[k].style.backgroundColor:yellow";
}
}
}
}
}
}
But I have this error :
- setting a property that has only a getter !
I don't understand why I can't...
Do you have any clue ?
Thanks a lot.
David.
_______________________________________________
dev-tech-dom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-dom