JSFiddle - React, Tailwind, and code Playground

by Gothdo

HTML

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

JavaScript

$(function() {
	var lastTimeStamp;
  $("input").select(function(event) {
  	if (!event.originalEvent || lastTimeStamp === Math.round(event.timeStamp)) return;
    lastTimeStamp = Math.round(event.timeStamp);
    $("div").text("Something was selected").show().fadeOut(1000);
    alert("Selected");
  });
  $("button").click(function() {
    $("input").select();
  });
});