Last active
October 11, 2020 19:02
-
-
Save 8ctopotamus/6b861258cf4ba7e35ad7ad77782c1f6e to your computer and use it in GitHub Desktop.
Quickly fill out a form for testing
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
Array.from( document.querySelectorAll('input, textarea') ).forEach(function(el) { | |
if (el.type === 'text' || el.tagName === 'TEXTAREA') { | |
el.value = 'test' | |
} else if (el.type === 'number' || el.type === 'tel') { | |
el.value = 100 | |
} else if (el.type === 'date') { | |
el.value = '2020-10-20' | |
} else if (el.type === 'checkbox') { | |
el.checked = true | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment