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

167
Visualizações
When I click on a radio button the checked attribute doesn't change

So I have this bit of code and I want it to change its selected attribute when I click on the other radio button.

<fieldset>
  <legend class="h4">Formati:</legend>
  <label class="radio-inline">
    <input type="radio" name="version_printimi" value="A4">A4
  </label>
  <label class="radio-inline">
    <input type="radio" name="version_printimi" value="Skontrino" checked="checked">Skontrino
  </label>
</fieldset>

They are inside a form and visually the radiobuttons do get changed but I need the changed attribute to change as well.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

you can use onchange event listener to both of the input tags to detect change, then call a function that adds an attribute to one of the radio inputs using setAttribute and remove an attribute from other radio using removeAttribute.

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