I need to find a way to pass the visible div to javascript. This may not even be the best way to accomplish what I’m trying to accomplish, so I’m open for other suggestions.
All my site content opens in a single overlay. When a button is clicked in the navigation, that content opens in the overlay. When another button is clicked, that content replaces the current content in the overlay. And so on.
The best identifier (that I’ve spotted) of which overlay is open, is (CSS) display:block…
and all the hidden divs are display:none….
So I want to pass which div has the display:block to javascript (Note: all the div’s have unique ID’s)
I’m sure this is something easy, But I can’t seem to find it…
Thanks in advance for your time!!
Each HTML element in JS has style property. You can read and change element style by calling for example
So you don’t need to pass anything to JS, it’s already there.