01.
document.addEventListener(
'keyup'
, (event) => {
02.
const thisTarget = event.target;
03.
let thisValue = thisTarget.value;
04.
if
(isNaN(thisValue)) {
05.
06.
07.
return
;
08.
}
09.
10.
const thisTr = thisTarget.closest(
'tr'
);
11.
let nextSibling = thisTr.nextElementSibling;
12.
while
(nextSibling) {
13.
thisSiblingInput = nextSibling.querySelector(
'.input-number'
);
14.
thisSiblingInput.value = (parseFloat(thisValue) + 1);
15.
thisValue = thisSiblingInput.value;
16.
nextSibling = nextSibling.nextElementSibling;
17.
}
18.
});