const divs = document.querySelectorAll('.hitung');
or
const divs = document.querySelector('button[type="submit"]');
divs.forEach(el => el.addEventListener('keyup', event => {
var fm=el.form;
fm['a[harga1]'].value=fm["a[bruto]"].value - (fm["a[diskon1]"].value * fm["a[bruto]"].value / 100);
fm['a[harga2]'].value=fm["a[harga1]"].value - (fm["a[diskon2]"].value * fm["a[harga1]"].value / 100);
fm['a[harga3]'].value=fm["a[harga2]"].value - (fm["a[diskon3]"].value * fm["a[harga2]"].value / 100);
fm['a[harga]'].value=fm['a[harga3]'].value;
event.preventDefault();
//console.log(event.target.classList[1]);
}));