English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

This is my code.

function hideAllInfo(){
els = document.getElementsByName('info');
for(i=0; i els[i].style.visibility = 'hidden';
}
}

I'm trying to hide three div elements at once.

Why is it not working in IE, while in Firefox it's okay? What's wrong? Something's wrong with my browser settings perhaps?

2007-09-25 20:26:43 · 4 answers · asked by M0 2 in Computers & Internet Programming & Design

4 answers

Have you considered nesting these 3 elements within a single parent DIV? In doing so, you can hide all three at once by changing the visibility of the parent DIV.

2007-09-25 20:34:43 · answer #1 · answered by Steve R 3 · 1 0

Here is a useful site listing seven ways to toggle an element. It also has functions to toggle multiple divs at once. It is more flexible than the code you have posted, and it works with all browsers:
http://www.dustindiaz.com/seven-togglers

2007-09-26 05:08:15 · answer #2 · answered by Anonymous · 0 0

Try using

els[i].style.display = 'none'
and
els[i].style.display = 'block'

to on and off diaplay.

regards
skpshah

http://www.skype.com/share/skypeprime/join/?&call=&skypename=skptechnomedia

2007-09-26 03:35:07 · answer #3 · answered by skptechnomedia 2 · 0 0

IE uses document.getElementByTagName("")
or document.getElementById("");

2007-09-26 03:37:09 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers