Michiel
07-27-2006, 12:08 AM
Hi,
I'm working on a script that modifies an unordered list. In de script I loop through an array which contains al list items:
var menuItems = tree.getElementsByTagName('LI');
for(var id=0; id<menuItems.length; id++) {
// modify list items
// e.g.:
menuItems[id].style.backgroundImage = 'url(\'bg_image.jpg\')';
}
Now I'm looking for a way to check whether the current list item is the last element of the tree, in order to assign a different background image to the last list item.
How can I do this?
Thanx! -Michiel
I'm working on a script that modifies an unordered list. In de script I loop through an array which contains al list items:
var menuItems = tree.getElementsByTagName('LI');
for(var id=0; id<menuItems.length; id++) {
// modify list items
// e.g.:
menuItems[id].style.backgroundImage = 'url(\'bg_image.jpg\')';
}
Now I'm looking for a way to check whether the current list item is the last element of the tree, in order to assign a different background image to the last list item.
How can I do this?
Thanx! -Michiel