In article <LV********************@twister.tampabay.rr.com> ,
mm******@cfl.rr.com enlightened us with...
For NN is there an array of, in this case, "members" I can iterate over as I
did with the IE script e.g. member[#].className?
For NN4?
I don't think so. NN4 only did layers, and that was a huge pain. Most of
us have just stopped programming for it and let our scripts degrade so
that the stuff doesn't crash old browsers.
I don't do commercial sites, so I have a caveat that my users must use
NN6+ if I have need of DHTML. My internet sites don't do anything fancy
that won't work in all browsers (as a requirement for function; they may
look prettier).
NN6+ can do the same DOM things as IE, for the most part, but your
script used IE only shortcuts, not DOM methods.
The standard is that all ids on a page should be unique.
NAME your cells the same name, then use getElementsByName to get all the
tags and style as appropriate. Note that getElementsByName is DOM only
and will not work in old browsers, so the check
if (document.getElementsByName)
should be used to avoid crashes.
I think you can say
document.getElementsByName("method")[i].className=class
but have not tried it. If that works, you can just use a loop to change
the class for all elements with that name.
So...not sure, but try this. (IE5+/NN6+/compatible)
<script type="text/javascript" language="javascript" >
function colortable(){
var members = document.getElementsByName("member")
for (var i=0; i < members.length; i += 2){
members[i].className = "white_bg";
}
}
</script>
<body onload = "colortable()">
<table id="pmdtable">
<tr>
<td name="member">
name
whatever
</td>
...
...
</tr>
</table>
--
--
~kaeli~
Murphy's Law #2030: If at first you don't succeed, destroy
all evidence that you tried.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace