JQuery Select Change

JQuery Select Change

[JQuery] DropDownList Selected Index Changed.

We can handle selected index change event of dropdownlist using JQuery. Let’s see how to use Change event in JQuery. First you need to find the dropdownlist html element by ID and attach change event to it.
 
$("#ddlTutorials").change(  // your code goes here );

Jquery script to get selected index change event of Dropdownlist.

<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 (){ 

    $("#ddlTutorials").change( 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 code for demo of get dropdownlist select change event using Jquery.

<div>
           <select id="ddlTutorials">
               <option value="Asp.net">Asp.net Tutorial.</option>
               <option value="Jquery">JQuery Tutorial.</option>
               <option value="C#.net">C#.net Tutorial.</option>
               <option value="VB.net">Vb.net Tutorial.</option>
               <option value="Tutorials">JQuery Tutorials.</option>
           </select>
</div>

Tags:

How to get Jquery selected optionJquery Gridview Dropdownlist Selected Change Enable Disable ControlsJquery Dropdown Selected ValueBasics of jqueryLearning JqueryAspnet Listbox Selectedindexchanged problems and solutionGet Selected Value From Dropdownlist [JQuery]JQuery Change Div background Color and Text Color On ClickJQuery how to change background imageJquery Select Table RowJQuery On Click Change Div Content

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.