• In this article we will explain how to select input box value in jquery or What is select() method in jquery
  • or why use select() method in jquery with example.


jQuery select event occurs when a text is marked or selected in text area or a text field. This event is limited to <input type="text"> fields and <textarea> boxes.


  • $(selector).select();

  • Example of jQuery select() method

Let's take an example to demonstrate jQuery select() Method.

<!DOCTYPE html>
    <script src="Scripts/jquery-1.8.2.min.js"></script>
        $(document).ready(function () {
            $(":input").select(function () {
                $("div").text($(this).val()+' text was Selected').show().fadeOut(2000);
    <input  type="text"/>


How to use select event in jquery

In above example when we select input box value then call select() method and show message

sqltutorialspoint text was Selected”. 



I hope this article will help to you.



Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like