Created
November 13, 2024 11:15
-
-
Save ninlith/c73594ed8477757b361a478acc843759 to your computer and use it in GitHub Desktop.
Click all radios
This file contains 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
// @name Click all radios | |
// @description Selects a random radio button from each uniquely named radio group. | |
javascript:(() => { | |
Object.values(Object.groupBy(document.querySelectorAll('input[type="radio"]'), e => e.getAttribute("name"))).forEach((arr) => { | |
arr[Math.floor(Math.random() * arr.length)]?.click?.(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment