for Keploy Fellowship Task - 3
This is a project made with public API Pokemon API.
It fetches the popular moves of a pokemon -> entered by the user -> and then display them as Output!
(NOTE: please write pokemon names in "SMALLCASE LETTERS" for the API to fetch the data.)
- This codeblock fetches the first 5 moves of Pokemon from the moves Array.👇🏻
fetch(url)
.then((res) => res.json())
.then((data) => {
let moveList = "";
for (let i = 0; i < 5; i++) {
moveList += `<i class="fa-solid fa-bolt"></i>` + " " + data.moves[i].move.name + " " + `<i class="fa-solid fa-bolt"></i>` + "<br>";
}
- This code block displays that data as output. 👇🏻
document.getElementById('output').innerHTML = moveList;