Click event on select option element in chrome

前端 未结 13 1196
闹比i
闹比i 2020-11-22 11:38

I\'m having a problem in Chrome with the following:

var items = $(\"option\", obj);  

items.each(function(){

    $(this).click(function(){

           


        
13条回答
  •  梦谈多话
    2020-11-22 11:55

    I found that the following worked for me - instead on using on click, use on change e.g.:

     jQuery('#element select').on('change',  (function() {
    
           //your code here
    
    }));
    

提交回复
热议问题