Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!