如下,當c.style.backgroundColor=="red"時 我可以通過點擊已占用在紅色和藍色之間切換div顏色可是,一旦改為 if(c.style.backgroundColor=="#fd4d4f"){ c.style.backgroundColor="#1fe26d"; }else{ c.style.backgroundColor="#fd4d4f" }就無法切換了
js中 style.backgroundColor能識別red或blue,卻無法識別如#1fe26d
呼如林
2019-02-15 19:14:28