var a=document.getElementById("con"); a.style.color="red"; a.style.backgroundColor="#ccc"
请问为什么这里
var a=document.getElementById("con").innerHTML;
不能实现改变颜色和背景颜色呢??
InnerHTML problem? Can someone explain it? -PHP Chinese website Q&A-innerHTML problem? Can you please explain it? -PHP Chinese website Q&A
Please watch and learn.
第二个获取的是id为con的标签里的内容,而背景色和颜色是标签的属性,不是标签里的内容的属性
InnerHTML problem? Can someone explain it? -PHP Chinese website Q&A-innerHTML problem? Can you please explain it? -PHP Chinese website Q&A
Please watch and learn.
第二个获取的是id为con的标签里的内容,而背景色和颜色是标签的属性,不是标签里的内容的属性