Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
Gm Script to click a radio button only highlights it, doesnt click it

I have a questionnaire (Yes/No questions) on a webpage that I need to create a grease-monkey script for, which will auto-select all "Yes" options (radio buttons with value yes in the page). I created the below script, but when I click the button it only highlights the "yes" option but does not actually click/select it.

Below is the code, which I believe is pretty straightforward. What could be wrong here:

var input=document.createElement("input");
input.type="button";
input.value="GreaseMonkey Button";
input.onclick = showAlert;
document.body.appendChild(input);

function showAlert()
{
    var btns = document.querySelectorAll('input[type="radio"]')
        for(var i=0;i<btns.length;i++){
           if(btns[i].value=="Yes"){
            btns[i].checked=true;
        }
    }
}

it only highlights it as per this pic

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda