Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This JS snipped makes the subscription modal in a Statuspal status page to open with the "Select services" option checked by default.
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