JSFiddle - React, Tailwind, and code Playground

HTML

<div>test
    <input type="button" />
</div>
<span>span</span>

JavaScript

$("input").click(function () {
    $(this).parent().siblings('span').andSelf().hide();
});