jQuery select() Method - CodingTag

jQuery select()


  • In jQuery, the select() function triggers the select event or we can say that it attaches a function to run when a select event occurs.
  • If we talk about the select event, it occurs when a text is selected or marked in a text area or a text field.

Related Topics:

jQuery blur
jQuery focus

jQuery select




If you want to trigger a function in it, the syntax will be:


Parameter description:

  • function: It represents the function to run when the select event is triggered. It is optional.


In this example, an alert box will open when you will select the text of the input field.

<title> jQuery Example </title>
<script type = "text/javascript"
alert("Name is selected");


<h2> jQuery Select Event Example </h2>
Name: <input class="name" type="text" name="fullname">


When you enter a name and select that an alert box will open.

Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments