if (e.target.classList.contains('btn')) {}
<form action="">
<div class="parent-block">
<input type="text">
<button class="btn" type="submit">click</button>
</div>
<div class="parent-block">
<input type="text">
<button class="btn" type="submit">click</button>
</div>
<div class="parent-block">
<input type="text">
<button class="btn" type="submit">click</button>
</div>
</form>
$.ajax({
url: urlTariffCalculationPassenger,
method: "GET",
data: TariffCalculationPassObj,
success: function(result) {
let res = 0;
let sidebarItem = $('.sidebar-item')
let tariffVal = $('#tariff-val')
let sumPrice = parseInt(localStorage.getItem("price")) || 0;
tariffVal.html(sumPrice)
sidebarItem.each(item => {
res += result.sum;
localStorage.setItem("price", res);
let sumPrice = parseInt(localStorage.getItem("price")) || 0;
tariffVal.html(sumPrice)
})
}
let newPassengersEdit = currentPassengers.map((item) => {
if (item.PassengersId == passengerIdEdit.value) {
"какой то код"
}
}
let idxPass = passengers.findIndex((p) =>
String(p.CabinCategoryID) ===
String(currentTariff[idxCabin].CabinCategoryID) );
deleteState(idxCabin, idxPass);
function deleteState(index, idxPass) {
if (index > -1) {
currentTariff.splice(index, 1);
updateState();
}
if (idxPass > -1) {
passDel = passengers.splice(idxPass, 1);
localStorage.setItem("Passengers", JSON.stringify(passDel));
}
}