2010年4月19日月曜日

jQueryでselectのoption要素を動的につくるメモ(断念)

$('#hoge').append(new Option(i, i)); 

てな感じで書いたら、IE8だけうまくいかない。
なのでjQueryの使用はあきらめて、

var elem = document.getElementById("hoge");
elem.options[i] = new Option(i, i);

って書いたらうまくいった。IEなんだかな~