Click event on select option element in chrome

前端 未结 13 1128
闹比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 12:12

    I don't believe the click event is valid on options. It is valid, however, on select elements. Give this a try:

    $("select#yourSelect").change(function(){
        process($(this).children(":selected").html());
    });
    

提交回复
热议问题