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

265
Views
Jquery how to get list of checked radio button value?

I have this jquery script

  function radiolist() {
        var radioChecked = [];
        var radios = $("input[type='radio']");
        //alert(radios.length);
        
        for (var i = 0; i < radios.length; i++) {
            if (radios[i].checked) {
                radioChecked.push(radios[i].val());
            }
        }
        alert(radioChecked);
    }

I want to save the list of checked radio buttons in the radioChecked array and access them. But I get the following error

Uncaught TypeError: radios[i].val is not a function

Why can`t to get radio button value ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you index an element in jQuery, it doesn't rewrap the element in jQuery. So, you can either use the vanilla javascript approach with radios[i].value, or rewrap it in jQuery with $(radios[i]).val().

about 4 years ago · Juan Pablo Isaza Report
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!