I have a page where I am using some plugins which are used to e.g. make a table header fixed.
Now I have to show a div
at top of the other div
based on its z-index
.
But the problem is that I have many dynamic divs like that so I cannot add a predefined z-index
.
What I want to do is, when I add a div (by click on a button) at the top of another, I need to check the maximum z-index value (of visible divs) present in the window.
How can I achieve this?
Suppose I have 10 element in HTML page and each have z-index form 1 to 10 respectively, so when I click a button I need a JS code that return me 10 as I have a div with z-index = 10
z-index may be defined inline on div on in class as well, any suggestion ?