Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple browser question

Status
Not open for further replies.

spicymango

Programmer
May 25, 2008
119
CA
I a doing somethin like following. I tested my code on IE, FireFox, Netscape, it works. Is there any major browser that does not
support div and style.display


Code:
<div id="setname" style="DISPLAY: block" align="center">


Code:
document.getElementById('setname').style.display = 'none';
document.getElementById('noname_fr').style.display = 'block';
 
As far as I know, if you have a div tag with a style set to block then something like this:

Code:
document.getElementById("myDivId").style.display = "block";
document.getElementById("myDivId").style.display = "none";

Will work in almmost every web browser that has javascript enabled.

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
vicvirk said:
As far as I know, if you have a div tag with a style set to block then something like this:

Code:
document.getElementById("myDivId").style.display = "block";
document.getElementById("myDivId").style.display = "none";

Will work in almmost every web browser that has javascript enabled.

The latter 2 lines will work regardless of whether the DIV has a style set or not, because they are setting the value, not testing it (single versus double equals signs).

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top