Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
Select some of the text: <input type="text" value="Hello world!" onselect="myFunction()">
<script>
function myFunction() {
  alert("You selected some text!");
}
</script>
</body>
</html>