Tell us what’s happening: can someone tell me what’s wrong in the code it’s not working
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>
/* 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