如下,当c.style.backgroundColor=="red"时 我可以通过点击
已占用
在红色和蓝色之间切换div颜色
可是,一旦改为 if(c.style.backgroundColor=="#fd4d4f"){
c.style.backgroundColor="#1fe26d";
}else{
c.style.backgroundColor="#fd4d4f"
}
就无法切换了
相关分类