$(".whitebox").on('change', function() {
var previousAmt = $(this).data("old"); // i want previous value
var id = this.id;
var slpitid = id.split("_");
var checkboxid = "#chck_" + slpitid[0];
if ($(checkboxid).is(':checked')) {
var tipFlag = true;
}
else {
var tipFlag = false;
}
if (tipFlag === true)
{
$("#amounttipchange").modal('show');
}
//alert(previousAmount);
});
我要存儲更改事件前值我怎樣才能jQuery的執行我不能夠存儲使用$值(此)。數據( 「舊」);任何幫助將不勝感激
請將您'HTML'代碼太 – Ionut
'我是無法使用$(this).data(「old」)存儲值 - 爲什麼? –
previousAmt = $(this).data(「old」)output is emtpty – user6885473