Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application.Contact : +91 9437911966 (Whatsapp) Note: Paid Service

jQuery select() method with example

The jQuery select event occurs when a text is marked or selected in text area or a text field. This event work only in <input type="text"> fields and <textarea> boxes. It is an inbuilt function of jQuery.


1. $(selector).select()
It triggers the select event for selected elements.
2. $(selector).select(function)
It adds a function to the select event.


<!DOCTYPE html> 
        <title>Select Method</title> 
        <script src= 
        <!-- JQuery code to show the working of this method -->
            $(document).ready(function() { 
                $("input").select(function() { 
                    alert("Something was selected"); 
                $("textarea").select(function() { 
                    alert("Something was selected"); 
            div { 
                width: 250px; 
                height: 40px; 
                padding: 20px; 
            <!-- select any thing from inside this field -->
            <input type="text" value="Student Tutorial!"> <br><br>
            <textarea rows="4" cols="50">At Student Tutorial!you will learn how to make a website. 

Run it Yourself »