Last active
December 31, 2023 07:45
-
-
Save mralfarrakhan/cef74d866fc1eec188bd3402f0ac4bdd to your computer and use it in GitHub Desktop.
EDOM auto-fill
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
| (() => { | |
| let radios = document.querySelectorAll('input[type=radio]'); | |
| for(let i = 0; i < radios.length; i++){ | |
| if(radios[i].getAttribute('value') == `${Math.floor(Math.random() * 2) + 4}`){ //randomly generate value 4-6 | |
| radios[i].checked = true; | |
| } | |
| } | |
| })() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bare minimum, run a couple times to fill all radios.