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

前端 未结 7 931
灰色年华
灰色年华 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:33

    I found as solution to make only

     
    

    in php/html file and then generate options for it by ajax:

    $.post("options_generator.php", function (data) { $("#myselect").append(data); });
    

    In options_generator.php echo options only:

    echo "";
    echo "";
    

提交回复
热议问题