JSFiddle - React, Tailwind, and code Playground

by ChinmayeeG

HTML

<div style="position:absolute; left:10px; top:10px; background-color:red; width:150px; height:150px">div 1</div>
<div style="position:absolute; left:80px; top:20px; background-color:magenta; width:150px; height:150px">div 2</div>
<div style="position:absolute; left:120px; top:10px; background-color:yellow; width:150px; height:150px">div 3</div>
<div style="position:absolute; left:110px; top:70px; background-color:green; width:250px; height:200px">div 4</div>
<div style="position:absolute; left:50px; top:100px; background-color:blue; width:200px; height:150px">div 5</div>

JavaScript

$("div").click(function(){
    $("div").css("zIndex",1);
    $(this).css("zIndex",100);
});