quote:
Originally posted by Ezra
But Only the first div shows up now, not the second and the third on that page
because you should be using .spoiler, not #spoiler. IDs cant be repeated anywhere on a page.
for (i=0;i<document.getElementsByTagName('div').length;i++) {
if (document.getElementsByTagName('div')[i].class='spoiler') {
if(document.getElementsByTagName('div')[i].style.display == 'none') {
document.getElementsByTagName('div')[i].style.display = '';
} else {
document.getElementById('spoiler').style.display = 'none';
}
}
}