Last active
September 29, 2020 13:12
-
-
Save messutied/fd2cd7f56c8ba0d381fb0408800a3c8a to your computer and use it in GitHub Desktop.
This JS snipped makes the subscription modal in a Statuspal status page to open with the "Select services" option checked by default.
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
document.addEventListener("DOMContentLoaded", function() { | |
var $ = document.querySelector.bind(document); | |
var subButton = $('.subscribe'); | |
var input = $('[name="subscription[filter]"][value="services"]'); | |
subButton.addEventListener('click', function () { | |
setTimeout(function () { | |
input.checked = true; | |
input.dispatchEvent(new Event('change')); | |
}, 0); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment