This is the repo: https://github.com/bvonpotobsky/weather-api
This is the fiddle: https://jsfiddle.net/bvonpotobsky/4sacrj85/1/
Im making cards, Im trying to remove them when clicking button
//! This function is not being recognized ?>
function removeCard(id) {
cities = cities.filter((city) => city.id !== id);
updateLocalStorage();
}
card.innerHTML = <h3 class="card__city">${city.name}, ${city.country}</h3>
<p class="card__update">Last update: 6:52 a.m.</p>
<p class="card__degree">${city.degrees}°</p>
<p class="card__description">${city.description}</p>
<span class="card__day">
<img class="card__day__icon" src="http://openweathermap.org/img/wn/${city.icon}.png" alt="Icon weather"/>
<p class="card__day__info">${city.min}°/${city.max}°</p>
<button onclick="removeCard(${city.id})" class="card__deleteBtn">Delete</button></span>;
I have that in a template string. Its not recognizing the function in the button!
Thanks!