JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrapper">
<div class="first">
test-content
</div>
</div>
CSS
.first {
background-color: yellow;
position: absolute;
width: 200px;
height: 100px;
}
.overlay {
background-color: red;
opacity: 0.4;
position: absolute;
width: 100px;
height: 50px;
z-index: 2;
}
JavaScript
var $first = $('div.first'),
$overlay = $('<div class="overlay" />'),
$list;
$first.before($overlay);
// build list out of elements
$list = $([ $first.get(0), $overlay.get(0) ]);
// modify the list
$list.css('border', '2px solid green');