Last active
April 18, 2018 02:28
-
-
Save sh78/9ece79951ec253555b57 to your computer and use it in GitHub Desktop.
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
/* use a CSS selector to change the value of multiple text inputs on a page with the browser console */ | |
// Enter a css selector to operate on | |
var theSelectorIsHere = 'TYPE_HERE'; | |
// Enter desired value | |
var whatItShouldBe = 'TYPE_HERE'; | |
// Don't worry about this part, paste in the the browser console | |
var whereItShouldBe = document.querySelectorAll(theSelectorIsHere); | |
function superDuperValChanger (targets, input) { | |
for (var i = targets.length - 1; i >= 0; i--) { | |
targets[i].value = input; | |
}; | |
} | |
superDuperValChanger(whereItShouldBe, whatItShouldBe); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment