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

118
Views
same id given to various btns

I recently visited a website and was checking through its html code and found that two different inputs of type radio were given same id, how can it be possible? I tried to check the radio buttons but I was only able to check the first button how do I check the other buttons using javascript if both are given same id image radio buttons on the website

image of html code where same id given

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

0

From MDN

elements of type radio are generally used in radio groups—collections of radio buttons describing a set of related options.

Only one radio button in a given group can be selected at the same time. Radio buttons are typically rendered as small circles, which are filled or highlighted when selected.

Every element on your document is expected to have a unique id value for its id property otherwise odd things would happen when trying to select those elements using a css selector both in styles and js (to cite one).

Here there's an in depth discussion on SO for example for further reference.

But for sure they are meant to be grouped using the same name attribute value to hint which group is expected to have a mutually exclusive checked status and to converge to the same GET/POST parameter, named like that name property and having as value the value of the only radio selected in its group, when its form will be submitted.

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!