Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!