JSFiddle - React, Tailwind, and code Playground
by pdjk
HTML
<html>
<body>
<div id="thePrev"></div>
<div id="theParent">
<div id="thisOne"></div>
</div>
</body>
CSS
#thePrev {
height: 200px;
width: 200px;
background: red;
}
#theParent {
height: 300px;
width: 300px;
background: blue;
}
#thisOne {
height: 100px;
width: 100px;
background: grey;
}
JavaScript
$("#thisOne").parent().prev().css({
background: 'black'
});