let dog = document.querySelector("p .dog"); dog.classList.add("cat"); dog.classList.remove("<strong>dog</strong>"); //attribute let weatherIconElement = document.querySelector("#weather-icon"); weatherIconElement.setAttribute( "src", `http://www.openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png` ); weatherIconElement.setAttribute("alt", response.data.weather[0].description);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter