ifなんて
もう使うもんか。
switch(this.style.backgroundColor){ case "#f00": case "rgb(255,0,0)": case "rgb(255, 0, 0)": this.style.backgroundColor = "#fff"; break; default: this.style.backgroundColor = "#f00"; }
var a = "a"; switch(true){ case a=="a": return 1; break; default: return 0; }
このスイッチのボタンっぽい響き。それに比べてifって何!? 仮定しちゃって。if使っていいのはプログラマまで!