IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes Handling DIV in IE and Netscape Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Handling DIV in IE and Netscape" Watch "Handling DIV in IE and Netscape" New topic
Author

Handling DIV in IE and Netscape

Dushyant Bhardwaj
Greenhorn

Joined: Apr 18, 2004
Posts: 28
Dear All,
I m working on a requirement where I need to use show-hide functionality.
This is working on IE perfectly using
if (document.all) {
for(iloop=0;iloop<document.all.hidPElmnt.length;iloop++)
{document.all.hidPElmnt[iloop].style.visibility = "visible";
}}
But I m not able to do it for netscape.
Can anybody tell me what is the equivalent code for above posted code
used for IE.
I m using
if (document.getElementById) {
document.getElementById("hidPElmnt").style.visibility = "visible";
}
but I m stuck with , how to iterate for all the elements whose ID is hidPElmnt.

Thanks in advance.

Regards
Dushyant Bhardwaj
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003


send the element name and how you want to show hide the element,
with using display it is "none" for hide, "block" for visible.
My 2 centson't use document.all, just use getElementById; IE supports both methods!

Eric
[ May 18, 2004: Message edited by: Eric Pascarello ]
Dushyant Bhardwaj
Greenhorn

Joined: Apr 18, 2004
Posts: 28
Thanks a lot Eric.

It worked !!!

Regards,
Dushyant Bhardwaj
 
 
subject: Handling DIV in IE and Netscape
 
Threads others viewed
Hide form elements in Netscape4.7
A loop for this script? A challenge for me!
what is the equivalent code on jsp?
javascript to jsp?
how to hide button using javascript
developer file tools