Hi, this is a bit complicated, so I will try and explain it.
Firstly, this is a HTML/CSS code being generated from a JavaScript file. Because my JavaScript is quite limited, and because I have already completed a lot of functions there are probably other better ways of achieving what I want, but considering I don't want to completely change my code, if possible please provide a solution closest to what I am asking for. Thank you.

Problem:

I have multiple div boxes in the exact some position.(As if frames of a TV)
Different div boxes are displayed depending on the z-index value.(If there are any other ways of achieving this please let me know)
In the div boxes are in page links that go to that part of the page.(However, the z-index value still does not change:()
I want the div of the link being clicked to be shown on top when clicked.

If anyone can think of a solution, please let me know.

As a test, I created the following, hopefully it can give you an idea of what I am interested in making. When I tested this, the main issues are that I need to always get the clicked element on top(having zIndex 1000 brings everything to the same zIndex.) I want to achieve this from an anchor tag, but I need to efficiently get the target div.

Hi, this is great. It is exactly the function I am looking for.
To be honest, I have a lot of trouble understanding CSS so I am always trying to use JavaScript instead. What exactly changes the block to be displayed on top here, as I see no z index in the code?

Quote:

Originally Posted by Excavator

Hello dammyg,
I worked this up a couple years ago. It uses anchors to load the different boxes.
Maybe you can use it?