L
libsfan01
hi!
i have written a function to make visible elements with a certain id.
however i intended it to be used to make visible multiple elements but
it only appears to switch on the first element it comes to with that
id. after that it appears to stop. i was wondering how i can adapt this
function to make visible multiple elements, will i need a different way
of referencing or can it be done through id?
your thoughts are greatly appreciated on this...
function toggleLayer( layerID ) {
var style2 = document.getElementById( layerID );
if (style2.style.display == "block") {
style2.style.display = "none";
}
else {
style2.style.display = "block";
}
}
kind regards
marc
i have written a function to make visible elements with a certain id.
however i intended it to be used to make visible multiple elements but
it only appears to switch on the first element it comes to with that
id. after that it appears to stop. i was wondering how i can adapt this
function to make visible multiple elements, will i need a different way
of referencing or can it be done through id?
your thoughts are greatly appreciated on this...
function toggleLayer( layerID ) {
var style2 = document.getElementById( layerID );
if (style2.style.display == "block") {
style2.style.display = "none";
}
else {
style2.style.display = "block";
}
}
kind regards
marc