question: in the code below, and in general, how would I input multiple
functions into the code, and get multiple outputs? basically, I want to
be able to add say 2 or 3 of the div's to the link so that it shows
multiple div's at once.
<script language="javas cript">
<!--
var state = 'none';
function hide(layer_ref) {
if (state == 'block') {
state = 'none';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.a ll." + layer_ref + ".style.dis play = state");
}
if (document.layer s) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getEl ementById &&!document.all ) {
hza = document.getEle mentById(layer_ ref);
hza.style.displ ay = state;
}
}
function show(layer_ref) {
if (state == 'none') {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.a ll." + layer_ref + ".style.dis play = state");
}
if (document.layer s) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getEl ementById &&!document.all ) {
hza = document.getEle mentById(layer_ ref);
hza.style.displ ay = state;
}
}
//-->
</script>
<p><a href="#" onclick="hide(' div1');">hide me</a></p>
<p><a href="#" onclick="show(' div1');">show me</a></p>
<div id="div1" style="display: none;">This is the content 1</div>
<div id="div2" style="display: none;">This is the content 2</div>
<div id="div3" style="display: none;">This is the content 3</div>
functions into the code, and get multiple outputs? basically, I want to
be able to add say 2 or 3 of the div's to the link so that it shows
multiple div's at once.
<script language="javas cript">
<!--
var state = 'none';
function hide(layer_ref) {
if (state == 'block') {
state = 'none';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.a ll." + layer_ref + ".style.dis play = state");
}
if (document.layer s) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getEl ementById &&!document.all ) {
hza = document.getEle mentById(layer_ ref);
hza.style.displ ay = state;
}
}
function show(layer_ref) {
if (state == 'none') {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.a ll." + layer_ref + ".style.dis play = state");
}
if (document.layer s) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getEl ementById &&!document.all ) {
hza = document.getEle mentById(layer_ ref);
hza.style.displ ay = state;
}
}
//-->
</script>
<p><a href="#" onclick="hide(' div1');">hide me</a></p>
<p><a href="#" onclick="show(' div1');">show me</a></p>
<div id="div1" style="display: none;">This is the content 1</div>
<div id="div2" style="display: none;">This is the content 2</div>
<div id="div3" style="display: none;">This is the content 3</div>
Comment