21 lines
698 B
JavaScript
21 lines
698 B
JavaScript
(function () {
|
|
const kwota = document.getElementById('kwota');
|
|
const opis = document.getElementById('opis');
|
|
const opisCount = document.getElementById('opisCount');
|
|
|
|
document.querySelectorAll('.btn-kwota').forEach(btn => {
|
|
btn.addEventListener('click', () => {
|
|
const val = btn.getAttribute('data-amount');
|
|
if (val && kwota) {
|
|
kwota.value = Number(val).toFixed(2);
|
|
kwota.focus();
|
|
}
|
|
});
|
|
});
|
|
|
|
if (opis && opisCount) {
|
|
const updateCount = () => opisCount.textContent = opis.value.length.toString();
|
|
opis.addEventListener('input', updateCount);
|
|
updateCount();
|
|
}
|
|
})(); |