I have a total of 20 spans with unique IDs, all set to hidden in my stylesheet.
To toggle the visibility of these spans upon clicking on sections of an image map, I created this script:
function showDiv(pass) {
var divs = document.getElementsByTagName('span');
for (i = 0; i < divs.length; i++) {
if (divs[i].id.match(pass)) {
(pass).style.visibility = 'visible';
divs[i].style.visibility = 'hidden';
}
}
}
The script works flawlessly in Internet Explorer, but Firefox seems to be having issues. Chrome also shows some minor problems that I believe can be fixed.
If you have any insights into why Firefox is not working or any suggestions for improvement, they would be sincerely appreciated and rewarded generously in the afterlife :)