select2 changing items dynamically

前端 未结 6 1835
执笔经年
执笔经年 2020-12-02 09:23

I have two selects that are linked: Each value of the first select determines which items will be displayed in the second select.

The values of the second select are

6条回答
  •  [愿得一人]
    2020-12-02 09:30

    In my project I use following code:

    $('#attribute').select2();
    $('#attribute').bind('change', function(){
        var $options = $();
        for (var i in data) {
            $options = $options.add(
                $('

    Try to comment out the select2 part. The rest of the code will still work.

提交回复
热议问题