您现在的位置是:首页 > 电脑技术查询 > web开发

var oOption = document.createElement("OPTION");解决方案

编辑:chaxungu时间:2022-10-02 23:15:45分类:web开发

var oOption = document.createElement("OPTION");
var oOption = document.createElement("OPTION");
oOption.text = data["nextLevelOrglst"][i].branchName;
oOption.value = data["nextLevelOrglst"][i].branchId;上面是给option加值和文本,请问怎么给oOption加字体颜色和背景颜色??????

成功立刻给分



------解决方案--------------------
JScript code var oOption = document.createElement("OPTION"); oOption.text = "text"; oOption.value = "value"; oOption.style.cssText += ";color: green; background-color: yellow;";