JSFiddle - React, Tailwind, and code Playground
HTML
<div class="search_box"></div>
<button>Add Class</button>
CSS
.search_box:after {
content: 'Contents of the after pseudo element';
}
.search_box.hidden:after {
display: none;
}
JavaScript
$('button').on('click', function() {
$('.search_box').addClass('hidden');
});