// we are trying to make a selection of options based on the pokemon different card generations with their value being the image of that generation of the card, then we want an event listener to check for a click us that takes the value and changes the photo.
// the problem I am running into is I’m trying to access the local var of options that’s nested in my conditional and I can’t seem to figure out how to access it so I can make the event listener work the way I intend it to.
// Code//
document.querySelector('#form').addEventListener('submit', getPokemon)
const img = document.querySelector('#img')
const sel = document.querySelector('#curPoke')
function getPokemon (e) {
e.preventDefault();
const poke = document.querySelector('#input').value.toLowerCase();
const url = `https://api.pokemontcg.io/v2/cards`;
fetch(url)
.then((res) => res.json())
.then((data) => {
data.data.forEach(card => {
if(poke === card.name.toLowerCase()){
let option = document.createElement('option')
option.textContent = `${card.name} ${card.id}`
option.value = card.images.large;
option.classList.add('gen')
sel.append(option)
sel.classList.remove('hide')
img.src = option.value
// console.log(card)
// console.log(option.value)
}
console.log(img.src)
})
console.log(data)
}).catch((err)=> console.log(err))
}
document.querySelector('option').addEventListener('click', function(){
img.src = option.value
} )
sel.addEventListener('click', function(){
// img.src = option.value
console.log('click')
const opt = document.querySelector('.gen')
console.log(opt)
} )
sildenafil generic australia – buy cheap sildenafil online sildenafil generic 100 mg
cialis tablets 20mg for sale – generic tadalafil canadian web pharmacy
stromectol tablets for sale – stromectole online ivermectin side effects
red dog casino – casino world casino online slots
herbal ed pills – erectile dysfunction treatment dr oz ed pills free trial
buy deltasone no prescription – generic prednisone 20mg drug order prednisone
viagra medicine in india – buy real viagra online where can i buy generic viagra online
cialis canada no prescription – Branded cialis generic cialis over the counter
ivermectin 0.1 uk – ivermectin brand name ivermectin 5
ordering neurontin online – neurontin 2400 mg can i buy levothyroxine from canada
cheapest viagra prices – Buy pfizer viagra 20 mg viagra daily
ivermectin 6 tablet – ivermectin online pharmacy stromectol uk buy
258612 653416Hey! Good stuff, do tell us when you post something like that! 252372
ivermectin 3mg tablet – ivermectin buy australia stromectol 0.5 mg
how much is ivermectin – ivermectin for humans ivermectin india
what is the generic for vardenafil – trusted online pharmacy reviews medicine erectile dysfunction
229206 205745wonderful issues altogether, you merely gained a new reader. What could you recommend about your post which you produced some days in the past? Any positive? 73388
509814 714071Awesome post , Im going to spend far more time researching this topic 609619
cheap viagra 150 mg – buy viagra idaho viagra 25 mg tablet buy online
512211 566499As I site possessor I believe the content matter here is rattling wonderful , appreciate it for your efforts. You ought to maintain it up forever! Best of luck. 297042
ivermectin for humans for sale – stromectol cost in usa ivermectin 6mg tablet for lice
empire casino online – parx casino online casino world
882416 873842Nowhere on the Internet is there this significantly quality and clear info on this subject. How do I know? I know because Ive searched this subject at length. Thank you. 298574
oral viagra – viagra ca cialis savings card
vrai viagra 200mg prix – tadalafil 5mg generique cialis 20mg pour homme
lowest price cialis cialis without a prescription
generic cialis tadalafil cialis cost
what is tadalafil where to buy generic cialis online safely
tadalafil cost walmart buy cialis pills
side effects for tadalafil https://cialismat.com/
tadalafil cialis tadalafil blood pressure
cialis at canadian pharmacy cheap generic cialis for sale
best price usa tadalafil buy cialis
buy tadalis tadalafil price walmart
tadalafil brands tadalafil cost in canada
cialis without a prescription https://extratadalafill.com/
https://cialisvet.com/ tadalafil order online no prescription
cost of cialis tadalafil blood pressure
ivermectin 6 mg http://www.ivermectinusd.com/
stromectol mexico https://www.ivermectinusd.com/
order ivermectin from india