
Originally Posted by
vwphillips
just noticed your posts & mentor bit so I must be missing the point
The Mentor part just means I know a couple of things the staff thinks might be helpful to others. Unfortunately JavaScript isn't one of them. The post count just means I need to step away from my computer a little bit more. 
I took a peek at your code and wasn't exactly what I was working at but darn close. I basically was trying to simulate a hash table so I wouldn't have to keep looping through an array later on in my script (this will save me about 50+ loops at 50 iterations per loop. Should boost performance of the script). The problem is for some reason the assignment doesn't seem to be working. This line:
Code:
labelsArray[labels[i].getAttribute("id")] = labels[i];
doesn't seem to do anything.
Eventually I wll be accessing this array in this manner:
Code:
function changeLabel(ele, color) {
labelsArray[ele.name].style.color = color;
}
var ele = document.forms[0].elements;
for (i=0; i < ele.length; i++) {
changeLabel(ele[i], "black");
}
I could post the whole code if it would be helpful. I was trying to avoid it because it's quite a bit to chew on and I think all of the code above is all that is relevant.
Bookmarks