var color = document.getElementById("id").style.backgroundColor;
此时color就是你要得到的背景色...
var s = document.getElementById("要获取td的id").style.background;
s就是得到的颜色
document.getElementById('id').style.backgroundColor="green";直接用对象访问样式的属性。
document.getElementById("td的id").style.backgroundColor
应该能取得
呵呵,楼上的回答都是对的,你看着用吧