/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function toggleLayer(whichLayer) { if (document.getElementById) { var style2 = document.getElementById(whichLayer).style; style2.display = style2.display? "":"block"; } else if (document.all) { var style2 = document.all[whichLayer].style; style2.display = style2.display? "":"block"; } else if (document.layers) { var style2 = document.layers[whichLayer].style; style2.display = style2.display? "":"block"; } }