javascript - Dropdownlist text is invisible in IE8 -
for reason ddl options invisible in ie8. they're there since list has 127 options text invisible. in firefox shows fine. tried putting inline style on select color set black !important. when inspect ddl firebug doesn't show inheriting styles, i've put inline.
i added var first line in loop in case kind of pass reference issue, hoping var create new variable each time through loop , not end single instance. didn't work either , i've read using var second time on variable in javascript not cause become new variable.
i'm populating drop downs array:
var option = document.createelement("option"); option.textcontent = "select..."; option.value = 0; departmentdropdownlist.appendchild(option); (var = 0; < departments.length; i++) { var option = document.createelement("option"); option.textcontent = departments[i][1]; option.value = departments[i][0]; departmentdropdownlist.appendchild(option); }
ie8 does not support textcontent
property. have shim , use innertext
instead.
option.textcontent = option.innertext = departments[i][1];
Comments
Post a Comment