Knockout virtual elements not working with Internet Explorer

前端 未结 1 1162
心在旅途
心在旅途 2021-01-13 18:00

If you run this Fiddle in Chrome, the select box is correctly filled with options A, B, and C. However, if you run it with Internet Explorer (version 8 or 9), it does not w

相关标签:
1条回答
  • 2021-01-13 18:42

    This is probably a limitation of Internet Explorer.

    Instead of a virtual element, use the options binding to populate a <select> element:

    <select id="type" name="type"
        data-bind="options: types, optionsText: 'desc', optionsValue: 'id', optionsCaption: '-- Choose --'">
    </select>
    

    Documentation: http://knockoutjs.com/documentation/options-binding.html

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