反正有沒有做到這一點:JavaScript的if語句
if (document.getElementById("x").value == 2 || document.getElementById("x").value == 3) {
//Do somthing
}
#我能把它簡單的在某種這樣的方式,我試過,但沒有奏效:
if (document.getElementById("x").value == 2 || 3) {
//Do somthing
}
的可能重複[使用Javascript:最漂亮的方式進行比較的多值一個值(HTTP://計算器。com/questions/9121395/javascript-the-prettiest-way-to-compare-one-value-against-multiple-values) – 2013-04-11 14:01:09