0
I have a term of use, and I need the button to be disabled until the user clicks "I have read and agree to the terms of use. You can help me?
0
I have a term of use, and I need the button to be disabled until the user clicks "I have read and agree to the terms of use. You can help me?
2
Just wear the event change
of checkbox
to set the property value disabled
button.
const checkbox = document.querySelector('#chk');
const button = document.querySelector('#bt');
checkbox.addEventListener('change', (e) => button.disabled = !e.target.checked);
<input type="checkbox" id="chk" /> Li e concordo com os termos
<br>
<button id="bt" disabled>Prosseguir</button>
Thanks, it worked out!
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
With
Javascript
neat? Got anyHTML
for example?– Sorack