I found a way to retrieve the z-index value using this code snippet:
findHighestZIndex('div');
function findHighestZIndex(elem)
{
var elems = document.getElementsByTagName(elem);
var highest = 0;
for (var i = 0; i < elems.length; i++)
{
var zindex=document.defaultView.getComputedStyle(elems[i],null).getPropertyValue("z-index");
if ((zindex > highest) && (zindex != 'auto'))
{
highest = zindex;
}
}
return highest;
}
The issue I encountered is that it returned 9999, and I need to identify the specific div, img or src element with that z-index value. My goal is to adjust the z-index to a lower value in order to place another element in front of it.
Thus far, my attempts to search by z-index and retrieve the corresponding source have been unsuccessful.