<html>
<body>
Some text: <input type="text" value="Select me!!" onselect="myFunction()">
<p>The function myFunction() is triggered when some text is selected in the input field. The function shows a message.</p>
<script>
function myFunction() {
alert("You have selected some text!");
}
</script>
</body>
</html>