> I want to use JavaScript when a button is clicked to show and hide a
> SPAN or DIV. This works in both IE and Netscape, but what I'd like to
> happen is for there to be no white space where the hidden div is.
Change the span/div display attribute:
spanRef.style.display = 'none'; // hides the span
spanRef.style.display = ''; // displays the span
Need to do some feature detection first, see below.
[...]
> <style type="text/css">
> .hidden
[quoted text clipped - 8 lines]
> }
> </style>
You may still need these for old Netscape, but otherwise you
don't need them any more.
> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
The language attribute is depreciated and replaced by the type
attribute. Just delete the language attribute.
> function toggle(id){
> if (ns4){
> document.layers[id].className =
> (document.layers[id].className=='hidden') ? 'fullsize' : 'hidden';
[...]
Don't use tabs in your code when posted here - replace with one
or two spaces. Manually wrap your code at about 65 characters
to allow for a couple of re-posts without wrapping.
Don't use browser detection, use feature detection - and test
for the most widely supported feature first. The following code
toggles an element between hidden and shown, tested in IE,
Firefox and Netscape 7.2.
You will need to add support for old Netscape and maybe really
old IE if you want.
<script type="text/javascript">
function toggle(id) {
if (document.getElementById) {
var el = document.getElementById(id);
} else if (document.all) {
var el = document.all(id);
} else if (document.layers) {
var el = document.layers[id];
}
if (el.style) {
if (el.style.display == 'none'){
el.style.display='';
} else {
el.style.display='none';
}
} else {
// browser does not support style object,
// hide some other way
}
}
</script>
<button onclick="toggle('aSpan');">toggle</button>
<span id="aSpan">a span</span>
[...]

Signature
Rob