Here is a straightforward approach to achieve this:
document.querySelectorAll('input[type="checkbox"]').forEach(el => {
const btn = el.closest('label').nextElementSibling;
el.addEventListener('change', evt => btn.disabled = !evt.target.checked);
});
<label>
<input class="checkbox" type="checkbox" checked="checked" id="checkbox">
</label>
<button class="contcats__form-btn" id="form-send" type="submit">send 1</button>
<label>
<input class="checkbox" type="checkbox" checked="checked" id="checkbox-header">
</label>
<button class="modal__form-btn" id="header__form-send" type="submit">send 2</button>
<label>
<input type="checkbox" checked="checked" id="checkbox-price">
</label>
<button class="modal__form-btn" id="price__form-send" type="submit">send 3</button>
It's important to note that:
const btn = el.closest('label').nextElementSibling;
could potentially lead to errors since it assumes the button is always the next sibling of the label. This can fail if the HTML structure changes. There are more reliable methods available, but it depends on your specific requirements.
Consider revising your HTML structure or exploring alternative approaches to ensure consistent selection of the associated button.