Created
July 1, 2016 18:46
-
-
Save LeandroLuque/5b85cd5895240ce94eb8badc482d0fd9 to your computer and use it in GitHub Desktop.
Completa encuestas unpsjb facultad de ingenieria
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
/* DISCLAIMER: | |
It doesn't complete all select fields, just the ones where the options are: | |
"Malo" .. "Muy bueno y satisfatorio" | |
The final value for all the options is set to: "Muy bueno y satisfatorio" | |
Target: http://www.ing.unp.edu.ar/encuestas/ | |
Authors: Luque Leandro, Pazos Bruno. | |
*/ | |
var selects = document.querySelectorAll('select[name^=preg]'); | |
for (var i = 0; i < selects.length; i++){ | |
var opcion = selects[i].querySelectorAll('option')[4]; | |
console.log(opcion); | |
if (opcion) | |
opcion.setAttribute('selected','selected') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment