Edit This Code:
<!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>


Result:
Try it Yourself - © w3schools.com
Privacy Policy