So, I’m trying to toggle the visibility of a div layer using javascript and this is what it looks like:
document.all["layer1"].style.visibility='visible';
and
document.all["layer1"].style.visibility='hidden';
What would the syntax look like for this if I’m trying to do it in Firefox? If I know that, then I’ll add in an if statement to check if the browser is firefox and use the alternate code.
document.allis a not a supported function, nor is it in the spec for the DOM (Here is more on that). You will have to grab the div by another method.querySelector
OR
getElemenyById
are two major methods.