12 lines
368 B
JavaScript
12 lines
368 B
JavaScript
(() => {
|
|
const checkbox = document.querySelector('#use-author-margin');
|
|
const discountInput = document.querySelector('#discount-percent');
|
|
if (!checkbox || !discountInput) return;
|
|
|
|
const updateDiscountInput = () => {
|
|
discountInput.disabled = checkbox.checked;
|
|
};
|
|
|
|
checkbox.addEventListener('change', updateDiscountInput);
|
|
updateDiscountInput();
|
|
})(); |