Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

131
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda