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

181
Visualizações
How to refresh a quiz without refreshing the web page?

I'm trying to add button to refresh the Quiz after answering the questions incorrectly but when I click reload it reloads the whole page instead, I'm using the function below, really appreciate any help. thanks

       $(function() {
                $("#myButton").click(function() {
                    window.location.reload();

                });
            });

Working Example Here

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

0

It sounds like you want to reset the form instead of refreshing the page. window.location.reload(); is basically hitting CTRL+R.

Consider just resetting the form tag.

document.getElementById('myform').reset();

Keep in mind, however, that you'll still have to reset any values located elsewhere (like the js files) that were based on user input.

If you want to retain the results of the quiz and visit another webpage, then you'll need to use AJAX and store the values in a backend somewhere.

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