How to fix IE select issue when dynamically changing options

前端 未结 13 521
南旧
南旧 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('');
    

    you'll get the bug, described above..

    BUT, if you instantiate

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

    no bugs occurred :)

提交回复
热议问题