Created
April 30, 2018 16:29
-
-
Save NickDeckerDevs/39a8a1ecbebe8354531e26d7a3cf5653 to your computer and use it in GitHub Desktop.
Pardot subscription center / full circle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function uncheckAllCheckboxes(checkboxes) { | |
| for(let i = 0; i < checkboxes.length; i++) { | |
| let checkbox = checkboxes[i]; | |
| if(checkbox.getAttribute('id') != 'list_87018' ) { | |
| checkbox.checked = false; | |
| } | |
| } | |
| } | |
| let checkboxes = document.querySelectorAll('input[type="checkbox"]'); | |
| for(let i = 0; i < checkboxes.length; i++) { | |
| let checkbox = checkboxes[i]; | |
| if(checkbox.getAttribute('id') != 'list_87018') { | |
| checkbox.addEventListener('click', (e) => { | |
| document.getElementById('list_87018').checked = false; | |
| }); | |
| } | |
| } | |
| let unsubCheckbox = document.querySelector('#list_87018'); | |
| unsubCheckbox.addEventListener('click', (e) => { | |
| if(e.target.checked == true) { | |
| uncheckAllCheckboxes(checkboxes); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment