1.设定选择项,在IE6下要特别注意
//下面的写法IE6下有问题
//$j("#sy")[0].selectedIndex = i;
//下面的写法兼容IE6,7,FF
$j("#sy")[0].options[i].setAttribute("selected", "true");
//$j("#sy")[0].selectedIndex = i;
//下面的写法兼容IE6,7,FF
$j("#sy")[0].options[i].setAttribute("selected", "true");
2.innerHTML,这个在IE下要特别注意。jQuery的html()没有这个bug
//兼容的写法
s.options[s.options.length] = new Option("xxx","xxx");
s.options[s.options.length] = new Option("xxx","xxx");
http://zhidao.baidu.com/question/33341046.html
3.jQuery环境下设置selected属性,IE下必须构造好所有option,然后设置某一个option的selected属性。FF没此问题,可以一次性构造select内的所有html,然后一次性jQuery.html()插入。