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

130
Visualizações
Button breaking page

i'm still learning to become a junior front end and got following issue if i press search button it breaks the page can figure out why. https://codepen.io/DeanWinchester88/pen/ExvxdxX

Could you have a look?

function searchPokemon(){
  let container = document.getElementById("container");
  container.insertAdjacentHTML("beforeend",`<div id="searchPokemonDiv"> ИТуц ыуфкс</div>`);
  let gotSearchPokemonDiv = document.getElementById("searchPokemonDiv");
  gotSearchPokemonDiv.innerHTML = `<form >
  <p>
    <label class="text">Search your pokemon</label><br>
    </p>
     <p>
    <label class="text">First name</label><br>
    <input type="text" name="name">
    </p>
      <p>
    <button id="pokemonSearchButton">Search</button>
  </p>
  </form>
  <div id="divForPokemonSearchResult">
  img
  </div>
  `;
  document.getElementById("pokemonSearchButton").addEventListener("click",  showPokemonSearchResult);
 
}
 function showPokemonSearchResult(){
    // document.getElementById("divForPokemonSearchResult").innerHTML = "VOT I RESULTAT";
    console.log("push to start")
  }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The bug was in this line:

<button id="pokemonSearchButton">Search</button>

and it was fixed by adding type="button" to the same, i.e.

<button type="button" id="pokemonSearchButton">Search</button>
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