Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda