在jQuery
我想比較if()
括號中的多個值,我的要求如下。 當前我在jQuery
中試過這個,請告訴我它是否適用於其他環境。這是可能的編碼
if((a==b && c==d) || (a!=b && c!=d)){
// code goes here
}
編輯
這是我的方案;
if (($(".product_attribute_input" + id + "_Color").children(":first").val() != "" && $(".product_attribute_input" + id + "_Size").children(":first").val() != "") || ($(".product_attribute_input" + id + "_Color").children(":first").val() !== undefined && $(".product_attribute_input" + id + "_Size").children(":first").val() !== undefined))
那麼究竟是什麼問題? – Mureinik
還有什麼其他的環境? – Vaibhav
@Mureinik以上條件是否有效?因爲它不在我的代碼 – user6594294