JSFiddle - React, Tailwind, and code Playground

HTML

<div class="rec" id="d1"></div>
<div class="rec" id="r1"></div>
<div class="rec" id="r3"></div>

CSS

.rec {
    height: 100px;
    width: 125px;
}
#d1 {
    background : lightgreen;
    border: 2px solid black;
    display: inline-block;
    left: 0%;
}
#r1 {
    background : red;
    border: 2px solid black;
    display: inline-block;
    left: 10%;
    position: relative;
}
#r3 {
    background : white;
    border: 2px solid black;
    display: inline-block;
    left: 20%;
    position: relative;
}

JavaScript

// Get the divs with class = "rec" and once clicked, run the function inside. The function inside will open a new window with that given link.
$(".rec").click(function () {
    window.open("http://www.google.com");
});