How to fix IE select issue when dynamically changing options

前端 未结 13 519
南旧
南旧 2020-12-04 16:38

I have a set of selects that all have the same options. Then I run those options through a filter so that any options that are selected in a different select don\'t show up

相关标签:
13条回答
  • 2020-12-04 17:06

    i've found the same bug in IE with select's.. this bug is the result of cloning DOM nodes..

    if you instantiating a SELECT like (jQuery style):

    $select = $template.clone();
    

    and then doing:

    $select.html('<option>111</option>');
    

    you'll get the bug, described above..

    BUT, if you instantiate

    $select = $('< div />').html( $template ).html();
    

    no bugs occurred :)

    0 讨论(0)
提交回复
热议问题