JSFiddle - React, Tailwind, and code Playground
HTML
<p class='close'>Close 1</p>
<div class="wrap_box">Content here</div>
<p class='close'>Close 2</p>
<div class="wrap_box">Content here</div>
<p class='close'>Close 3</p>
<div class="wrap_box">Content here</div>
JavaScript
//Close chat
$('.close').click(function () {
//do what ever you want here
$(this).next('.wrap_box').hide();
});