首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-03-31 
var oOption document.createElement(OPTION)var oOption document.createElement(OPTION)oOpti

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;"; 

热点排行