Forum Moderators: open
1.
Can you make an iteration so I need not repeat if using same styles over and over again?
2. Is it needed to declare vars too
eg var a = document.getElementById('blueberriesNav');
var aSpans = document.getElementsByTagName('span');
// do the loop
for (var i = 0; i < aSpans.length; i++) {
// perform the action only on specific elements
if (aSpans[i].id.indexOf('Nav') > -1) {
aSpans[i]].className = 'makeImgVisible';
}
} There has to been a pattern in the ID's for this to work, of course.