So normally we can get z-Index value of a div element using, e.g:
var zindex = document.getElementById(\'id\').style.zIndex;
I am using this
Default z-index
of any element is 'auto'
with exception of which has default z-index:0
. 'Auto' means that element gets z-index from its parent.
You can see this by using Developer Tools (in Chrome) or any similar tool in other browser. Also you can get this in your code by window.getComputedStyle() as others proposed here.