How to get jQuery dropdown value onchange event How to get jQuery dropdown value onchange event jquery jquery

How to get jQuery dropdown value onchange event


Try like this

 $("#drop").change(function () {        var end = this.value;        var firstDropVal = $('#pick').val();    });


$('#drop').change(    function() {        var val1 = $('#pick option:selected').val();        var val2 = $('#drop option:selected').val();        // Do something with val1 and val2 ...    });


If you have simple dropdown like:

<select name="status" id="status">    <option value="1">Active</option>    <option value="0">Inactive</option></select>

Then you can use this code for getting value:

$(function(){ $("#status").change(function(){     var status = this.value;     alert(status);   if(status=="1")     $("#icon_class, #background_class").hide();// hide multiple sections  });});