graphxdiva
asked on
Show / Hide div not working in IE6
As you can see from the code below, I am trying to hide / show a div when the link is clicked. Works fine in all browsers except IE6. Any ideas what I am doing wrong?
Thanks for any help.
Thanks for any help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script language="javascript" type="application/javascript">
function showhide(show, hide) {
var show = document.getElementById(show);
var hide = document.getElementById(hide);
show.style.display = "block";
hide.style.display = "none";
}
</script>
</head>
<body>
<center>
<div><a href="controlpanel.php">Back To Control Panel</a><br />
<a href="javascript:showhide('bands','venues')">View Preformers</a> | <a href="javascript:showhide('venues','bands')">View Showplaces</a></div>
<div id="bands" style="width:50%; display:none; background:#FF0000; height:300px;">
</div>
<div id="venues" style="width:50%; display:none; background:#0000FF; height:300px;">
</div>
</center>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured it was something simple. Thanks!
function hidediv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('h
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibili
}
else { // IE 4
document.all.hideshow.styl
}
}
}
function showdiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('h
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibili
}
else { // IE 4
document.all.hideshow.styl
}
}
}
</script>