-2
我有兩個文本框命名txtA,txtB簡單如果別人無法獲得工作
var count;//which needs to be compared with BValue
var AValue = $("#txtA").val();
var BValue = $("#txtB").val();
if (AValue == "") {
alert("Enter AValue and continue");
} else if (BValue == "") {
alert("Enter To BValue and continue");
} else if (AValue > BValue) {
alert("AValue should be lesser than To BValue");
} else if (AValue == "" || BValue == "") {
alert("Please enter the AValue and BValue to continue");
} else if (AValue == "0") {
alert("Invalid AValue");
} else if (BValue > count) {
alert("Invalid BValue");
} else {
// do some operations here
}
所有條件都經過良好,但這種BValue > count
被觸發我雖然滿足條件
我想你忘了關括號。因此:if($(「Value ==」)) – 2016-07-30 04:51:41
if($(「AValue ==」)「if not(AValue == ==」)我在OP – guradio
語法錯誤中看不到'BValue> 「」) –