Get Selected Value From Dropdownlist [JQuery]

Get Selected Value From Dropdownlist [JQuery] JQuery Get Selected value from dropdown.

To get selected value in dropdown list, we will use Jquery option and text method.

First we need to find the dropdown list by it's ID. To get selected value use option:selected.

var selectedValue = $("#ddlTutorials option:selected").val();
         
var selectedText = $("#ddlTutorials option:selected").text();

Jquery Script to get selected value and text.

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

    <script type="text/javascript" language="javascript">
       
    
    $(document).ready( function (){ 
    
        $("#Button1").click( function(){
        
          var selectedValue = $("#ddlTutorials option:selected").val();
          
          var selectedText = $("#ddlTutorials option:selected").text();
               
          alert("Selected Value is: " + selectedValue );
          alert("Selected Text is: " + selectedText );
          
        
         });
                        
     });
    
    </script>

HTML dropdown list code.

<div>
           <select id="ddlTutorials">
               <option value="Asp.net">Learn Asp.net.</option>
               <option value="Jquery">Learn JQuery.</option>
               <option value="C#.net">Learn C#.net.</option>
               <option value="VB.net">Learn Vb.net.</option>
               <option value="Tutorials">JQuery Tutorials.</option>
           </select>
           <input id="Button1" type="button" value="Submit Selected value" />
       </div>

Tags:

Jquery Dropdown Selected ValueGet Selected Value From Dropdownlist [JQuery]Jquery Gridview Dropdownlist Selected Change Enable Disable ControlsJQuery get Value Of TextareaJQuery Hidden Field Set ValueJquery Get Target Of EventJQuery TextBox Value()JQuery Get Element By ID or class name or tag nameJquery Set Value Of Textbox.JQuery Get .next() ElementLearning Jquery

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.