JSFiddle - React, Tailwind, and code Playground
HTML
<button class="btn-close">Does it works?</button>
CSS
.btn-close{
position: relative;
height: 30px;
border: none;
background-color: #332b2a;
color: #fff;
outline: none;
cursor: pointer;
}
.btn-close:after {
content: " ";
display: block;
position: absolute;
width: 30px;
height: 30px;
right: -32px;
top: 0;
background-color: #332b2a;
}
JavaScript
$(document).ready(function(){
$(document).on('click', '.btn-close', function(){
alert("It works!");
});
});