我有這個問題。我無法弄清楚我的代碼有什麼問題。我只需要隱藏內聯編輯圖像按鈕$ principal_amt == $ balance_amt但我的代碼什麼都不做。這裏是我的代碼:隱藏內嵌編輯圖像按鈕不起作用
//編輯圖像按鈕:
<td <?php echo $rowclass; ?>>
<?php echo $html->linkWithImage('Edit','cashadvance/update/' . $cashadvance["id"], array(), 'editicon.png', array('class' => 'try')); ?>
</td>
// JS:
$("#principal_amt").change(function(){
var principal = $("#principal_amt").val();
$("#balance_amt").val(principal);
if("#balance_amt" == "#principal"){
$('.try').show(true);
}
else{
$('.try').hide(true);}
});
再次,條件總是返回true。 – adeneo
@adeneo'$(「#balance_amt」).val(principal);'在這一行中,他設定的餘額等於本金額,每次它等於本金時,OP的一個不清楚的問題。 –