Hi Everyone,
I have written a very small page (and accompanying script) to test the visibility altering behaviour of IE. I am trying to hide or show a <div> element, alternatively based upon a button being pressed. The code does not work as I had hoped, hence why I am posting. If anybody can provide some pointers as to how I might be able to get this code going I will be very appreciative. Thanks heaps.
Regards
Davo
<html>
<head>
<title> Experimenting with toggling element visibility </title>
<style type="text/css">
#box
{
background-color: #00ff00;
left: 50px;
height: 100px;
position: absolute;
top: 50px;
width: 100px;
}
#place_button
{
left: 100px;
position: absolute;
top: 300px;
}
</style>
<script type="text/javascript">
var visibile = true;
function toggleMenu()
{
if(visibile == false)
{
document.getElementById("box").visiblity = "show";
visibile = true;
}
else
if(visibile == true)
{
document.getElementById("box").visibility = "hidden";
visibile = false;
}
}
</script>
</head>
<body>
<div id="box">
<form>
<input id="place_button" type="button" value="Click This" onclick="toggleMenu()">
</form>
</div>
</body>
</html>
I have written a very small page (and accompanying script) to test the visibility altering behaviour of IE. I am trying to hide or show a <div> element, alternatively based upon a button being pressed. The code does not work as I had hoped, hence why I am posting. If anybody can provide some pointers as to how I might be able to get this code going I will be very appreciative. Thanks heaps.
Regards
Davo
<html>
<head>
<title> Experimenting with toggling element visibility </title>
<style type="text/css">
#box
{
background-color: #00ff00;
left: 50px;
height: 100px;
position: absolute;
top: 50px;
width: 100px;
}
#place_button
{
left: 100px;
position: absolute;
top: 300px;
}
</style>
<script type="text/javascript">
var visibile = true;
function toggleMenu()
{
if(visibile == false)
{
document.getElementById("box").visiblity = "show";
visibile = true;
}
else
if(visibile == true)
{
document.getElementById("box").visibility = "hidden";
visibile = false;
}
}
</script>
</head>
<body>
<div id="box">
<form>
<input id="place_button" type="button" value="Click This" onclick="toggleMenu()">
</form>
</div>
</body>
</html>