How to get jQuery dropdown value onchange event

前端 未结 4 851
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 15:45

I have added two jQuery UI Dropdown Autocomplete script. Now I want get both value onchange of second dropdown and want to store separately in variable. How it is possible?<

4条回答
  •  清歌不尽
    2020-12-12 16:10

    If you have simple dropdown like:

    
    

    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
      });
    
    });
    

提交回复
热议问题