Return to Snippet

Revision: 11370
at February 3, 2009 13:18 by nerdsane


Initial Code
<script language="javascript">
<!--
var state = 'none';

function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//-->
</script>

Initial URL
http://ooopx.net

Initial Description
this code snippet will let u show/ hide a div element easily.

<a href="#">share it</a>

Initial Title
Show Hide a Div with Javascript

Initial Tags

                                

Initial Language
JavaScript