css中直接的style调用,用:
document.getElementById("main").style.backgroundColor;可以
如果是指定的class的Css格式的话, <div class="testClass">
abc
</div> <div id="testId">
abc
</div>.testClass{
background-color:red;
}.testId{
background-color:red;
}
我想问对于第二种使用ID指定的css样式,在JS中要怎么调用? 谢谢了。。
document.getElementById("main").style.backgroundColor;可以
如果是指定的class的Css格式的话, <div class="testClass">
abc
</div> <div id="testId">
abc
</div>.testClass{
background-color:red;
}.testId{
background-color:red;
}
我想问对于第二种使用ID指定的css样式,在JS中要怎么调用? 谢谢了。。
background-color:red;
}
background-color:red;
}
是这样的吧
#testId{
background-color:red;
}
问题那个就没有className啊..
怎么调用??
background-color:red;
}document.getElementById("testId").className="xxxx"