$balance = 500;
$transactionAmount = 300;
$newBalance = $balance - $transactionAmount;
if ($newBalance > 0) {
//some logic with transfer between bills
} else {
//ohh dude, you write wrong amount, please change your amount
}
if ($newBalance < 0) {
//ohh dude, you write wrong amount, please change your amount
return false;
}
//some logic with transfer between bills
...
let output_clock = timer_life >= 10 ? w + ':' + m + ':' + s : s;
$('#timer > strong').text(output_clock); //#timer > strong - is you selector, change it please
ps код ниже не проверял, могут быть синтаксические ошибки - поправить самостоятельно
function chooseRegion() {
console.log('send request to somewhere..')
return true;
}
let timeoutInput;
$('#inputRegion').keyup(function(e) {
clearInterval(timeoutInput);
console.log('request was cancelled');
if($(this).val().length > 2){
timeoutInput = setInterval(function () {
chooseRegion();
clearInterval(timeoutInput);
}, 3000);
}
});