Hello everyone,
Basically I am looking to show/hide a DIV with the click of a button.
The script work accordingly in IE but fail in FF.
I am sure I am the problem here.
<script type="text/javascript">
function toggle(box) {
var el = document.getElementById('box');
el.style.display = (el.style.display != 'none' ? 'none' : '' );
value = document.getElementById('content').value;
if(value=="Show Calendar"){
document.getElementById('content').value="Hide Calendar";
}
else{
document.getElementById('content').value="Show Calendar";
}
}
</script>
<style type="text/css">
#box{
background-color: #C0C0C0;
height: 100px;
width: 100px;
}
</style>
</head>
<body>
<div id="box">
</div>
<input id="content" value="Hide Calendar" type="button" onclick="toggle(box)" />
</body>
</html>
Thank!