-4
我在做一個方程式計算器。我想要做的就是提醒是否存在「C」值輸入,因爲如果存在「C」值,我想要做其他事情。即使有「C」值,它也會給我結果。請幫忙。jquery跳過我的if語句
$('#resultButton').click(function() {
var cValue = $("#cText").val();
if (cValue == ""){
var aValue = $("#aText").val();
var bValue = $("#bText").val();
var result = Math.sqrt((aValue*aValue)+(bValue*bValue));
$('#result').text(result);
}
else {
alert('There is a C value');
}
});
你應該看看[問]和[MCVE] – pvg