Select Event




Type anything in below textbox and than select text to trigger the event



Sourcode

    Try It Yourself
 
<html>
<head>


<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />


<script type="text/javascript" language="Javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

</head>
<body>

<h2>Select Event</h2>
<hr />
<br /><br />

<p>
<b>Type anything in below textbox and than select text to trigger the event</b><br />
<textarea id="txtInput" rows="5" cols="20">Welcome to the world of JQuery</textarea>
</p>

<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("#txtInput").select(
            function () {
                alert("Text content is selected");
            }
        );

    });
</script>

</body>
</html>
Share with your friends!!