将字体颜色更改为白色 - JS

时间:2015-03-04 08:04:26

标签: javascript

我应该在这行代码中插入什么代码才能将字体颜色更改为白色,我应该怎么做?

document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" | "+nhour+":"+nmin+":"+nsec+ap+"";
setTimeout("GetClock()", 1000);

2 个答案:

答案 0 :(得分:3)

var x = document.getElementById('clockbox');
x.style.color = '#FFFFFF';

答案 1 :(得分:0)

只需:

document.getElementById('clockbox').style.color="white";