JSFiddle - React, Tailwind, and code Playground
HTML
<input type="search" id="test" />
JavaScript
$("#test").on('search', function () {
alert("hej");
// this function will be executed on click of X (clear button)
});
<input type="search" id="test" />
$("#test").on('search', function () {
alert("hej");
// this function will be executed on click of X (clear button)
});