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

120
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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