I need to implement an alert-type modal popup that appears with a dimmed background. The problem is, we may have other elements on the page being showed that are also modals with z-indexes above default.
How do I determine the appropriate z-index that makes a given element the highest-layered element?
(jQuery is fine.)