开发者

Mootools - Scope problem in IE

Im starting to play with mootools but not sure why the following will hide me options in a select list, but in IE it will not:

<select id="test_select开发者_开发问答" multiple>
        <option>A</option>
        <option>B</option>
        <option>C</option>
</select>

$$('#test_select option').each(function(el){
        el.addClass('hide');
});

I really would appreciate a bit of help on this...


To hide an option in a select you must remove the Option from the select in IE.

Here is an explanation in further detail Hide Option in Select

To remove option element from Select w/ Mootools you can do the following: jsfiddle

$$('#test_select option').each(function(el){
        if(el.get("html") == 'A')
            el.destroy();
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜