JSFiddle - React, Tailwind, and code Playground

by DreamTexX

HTML

<h2>Wetter in Dresden:</h2>
<p id="description"></p>
<p>Temperatur: <span id="temperature"></span></p>
<p>Wind: <span id="wind"></span></p>

JavaScript

fetch("https://goweather.herokuapp.com/weather/Dresden")
  .then(response => {
    return response.json();
  })
  .then(data => {
    const temperature = data.temperature;
    const wind = data.wind;
    const description = data.description;
    document.getElementById("description").innerText = description;
    document.getElementById("temperature").innerText = temperature;
    document.getElementById("wind").innerText = wind;
  })
  .catch(err => {
    console.error(err);
  });