gpt4 book ai didi

mootools - HTML - MOOTOOLS- 添加选项以在 ie6 中选择框

转载 作者:行者123 更新时间:2023-12-04 06:45:21 29 4
gpt4 key购买 nike

<select id="selectId">
<option>Please select product ...</option>
</select>

我尝试使用 Firefox 并且它工作正常
$('selectId').innertHTML = '<option>Test test</option>'

但在 ie 上,它不起作用,如何在 ie 中通过字符串选项添加选项,如上

最佳答案

使用 Element类代替:

new Element('option', {
text: 'test option'
}).inject($('selectId'));​

示例: http://www.jsfiddle.net/EJH5b/

关于mootools - HTML - MOOTOOLS- 添加选项以在 ie6 中选择框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3818802/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com