Build a Pokémon Search App Project - Build a Pokémon Search App

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>

  </head>
<body><form id="search">
  <input id="search-input" type="text-input" required/>
  <button id="search-button">search</button></form>
   <ol>
     <ul id="pokemon-name">name<ul>  
     <ul id="pokemon-id">id</ul>
     <ul id="weight">weight</ul>
     <ul id="height">height</ul>
     <ul id="types">types</ul>
     <ul id="hp">hp</ul>
     <ul id="attack">attack</ul>
     <ul id="defense">defense</ul>
     <ul id="special-attack">s-attack</ul>
     <ul id="special-defense">s-defense</ul>
     <ul id="speed"></ul>
     

   </tr>
</body>
<script src="./script.js"></script>
/* file: styles.css */

/* file: script.js */
const searchinput = document.getElementById("search-input");
const srchBtn = document.getElementById("search-btn")
const name = document.getElementById("pokemon-name")
const id = document.getElementByUd("pokemon-id")
const weight= document.getElementById("weight")
const height = document.getElementById("height")
const types = document.getElementById("types")
const hp  =document.
getElementById("hp")
const attack = document.
getElementById("attack")
const defense = document.
getElementById("defense")
const specialatk = document.
getElementById("special-attack")
const specialdef = document.
getElementById("special-defense")
const speed = document.
getElementById("speed")
 const allpoki="https://pokeapi-proxy.freecodecamp.rocks/api/pokemon"

let pp = "https://pokeapi-proxy.freecodecamp.rocks/api/pokemon/{name-or-id}"


srchBtn.addEventListener("click",(e)=>{
  e.preventDefault()
  if(searchinput !== allpoki){
    alert("Pokémon not found")
  }
})
showresult.style.display="block"

const searchpoki = ()=>{
  if (searchinput === allpoki){
      let name = name
      name = allpoki.name
      id =  allpoki.id
      hp = allpoki.hp
      attack=allpoki.attack
      defense= allpoki.defense
      specialatk= allpoki.specialatk
      specialdef= allpoki.specialdef
      speed =allpoki.spped
  }
}

Your browser information:

User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Mobile/15E148 Safari/604.1

Challenge Information:

Build a Pokémon Search App Project - Build a Pokémon Search App

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Hi @h81371417

I spotted a typo.

.getElementByUd

Describe the other issues in your own words. Learning to communicate problems is a part of becoming a web developer.

Happy coding

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.