0
我需要在点击时将类样式属性颜色的值从红色更改为绿色。Onclick更改类样式值而不更改类名称
<style>
.c1
{
color : RED;
}
</style>
<a id="a1" class="c1" onclick="changeclassstyle()">
Hi
</a>
<script>
function changeclassstyle()
{
/* here i need to change the style of class c1 */
}
</script>
我需要将c1类的颜色更改为绿色。
注:我不希望它与“ID” &我不要创建新类和更改类名来完成。我希望它发生在相同的类名。
你的意思是想改变''