讓利串說,我有這樣的:JavaScript來利用價值得到使用的.html作爲條件
alert($('#child_check').html());
if($('#child_check').html() != "Select..." || $('.funnel_items').val() == "5" || $('.funnel_items_sub').val() != "Select..."){
return true;
}else{
alert("No Sub category selected!");
return false;
}
的html的回報:
No available selection for this action.
我將如何能夠檢查是否.html等於輸入的字符串,因爲如果我警告$('#test').html()它包含該字符串,但條件不返回true,所以我想知道這個代碼有什麼問題?
也真的不可能使用html的值作爲字符串比較的CODI
謝謝
從'html的返回值進行比較()'到另一個字符串應該正常工作。問題很可能是您的條件錯誤,或者.html()的返回結果實際上不匹配。沒有看到HTML,這是不可能說的。 – 2013-03-22 22:26:56
添加了由.html返回的值 – magicianiam 2013-03-22 22:34:25