JSFiddle - React, Tailwind, and code Playground

HTML

<button>Click To Select</button>
<input type="text" value="Some text">
<div></div>

JavaScript

$(function() {
  $(":input").select(function() {
    $("div").text("Something was selected").show().fadeOut(1000);
    alert("Selected");
  });
  $("button").click(function() {
    $(":input").select();
  });
});