JSFiddle - React, Tailwind, and code Playground

HTML

<div id="xyz"> hello </div>
<div class="content"> world </div>
<p>
<button onclick="hideWorld()">
Hide world
</button>
</p>

CSS

#xyz + .content {
  background-color: yellow;
}

JavaScript

const hideWorld = function() {
	document.querySelector("#xyz + .content").style.display = "none"
};