View Full Version : Layer Visible

25 Jul 2009, 12:55 PM

I'm not very good at javascript, therefor I'm asking for help with this. On my site I want to make it so when you click on a certain link, a layer becomes visible, this is possible by javascript, but all the scripts I've found with google only focus on showing and hiding one div. Is there anyone who can tweak the following code to work for multiple layers?

function swapform() {
var visable
var hidden
visable = document.getElementById("visible").innerHTML;
hidden = document.getElementById("theform").innerHTML;
document.getElementById("visible").innerHTML = hidden;

<div id="visible">
<input type="button" value="change form" onclick="swapform();">

<div id="theform" style="visibility: hidden">
<form action="blah.asp" method="post">
<tr><td><input type="text" value="Insert Name">
<tr><Td><input type="submit" value="rub a dub">