alphacooler
Programmer
I have a list (<ul></ul>) that has some <span> tags in it.
I would like to use DHTML to dynamically style this list based on different user selections through a form.
On an onBlur of a field I want to change the color of *all spans* contained in <ul></ul>.
Say <ul> has id="my_list" so I could access all <span> tags like this:
var aSpans = my_list.getElementsByTagName("span");
Now what do I do to access *all* the spans to change their .style.color attributes?
Do I count the objects returned and loop through setting the styles?
I would like to use DHTML to dynamically style this list based on different user selections through a form.
On an onBlur of a field I want to change the color of *all spans* contained in <ul></ul>.
Say <ul> has id="my_list" so I could access all <span> tags like this:
var aSpans = my_list.getElementsByTagName("span");
Now what do I do to access *all* the spans to change their .style.color attributes?
Do I count the objects returned and loop through setting the styles?