西属撒哈拉
2016-08-30 22:12
var a=document.getElementById("con");
a.style.color="red";
a.style.backgroundColor="#ccc"请问为什么这里
var a=document.getElementById("con").innerHTML;不能实现改变颜色和背景颜色呢??
第二个获取的是id为con的标签里的内容,而背景色和颜色是标签的属性,不是标签里的内容的属性
JavaScript进阶篇
469056 学习 · 22582 问题
相似问题