Jquery .change() function not working with dynamically populated SELECT list

前端 未结 7 918
灰色年华
灰色年华 2020-12-05 14:13

I have a select field that is dynamically populated with an ajax call that simply returns all the HTML select options. Here is the part of the PHP that just echo\'s the sel

7条回答
  •  借酒劲吻你
    2020-12-05 14:24

    An example using .live()

    $('#my_form_id select[name^="my_select_name"]').live('change', (function () {
        console.log( $("option:selected", this).val());
        })
     );
    

提交回复
热议问题