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

198
Visualizações
Is there any way I can navigate to a link using options in html using JavaScript?

I created a list of options using html and placed a button beneath it...I want the user to select an option and when he clicks on the button,it redirects him to a different page... Is there anyway that I can do this using JavaScript please?

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

0

Yes, window.location.href = "/someLocation" just is made for you.

about 4 years ago · Juan Pablo Isaza Relatório

0

when you click in the button you can call a function and inside of this function you put window.location.href = "your-url" or you can use window.open("your-url") to open a new tab.

<select onChange="goToPage(value)">
  <option disabled selected value> -- select an option -- </option>
  <option value="https://google.com" > google </option>
  <option value="https://stackoverflow.com" > stackOverflw </option>
  <option value="https://github.com" > git </option>
</select> 
 
<script>
  function goToPage(value) {
    window.location.href = value
  }
</script>

you an see more in this link here

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