JSFiddle - React, Tailwind, and code Playground

by Plippie Plop

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/3.0.0/fetch.min.js"></script>
<button id="getStuff">Get Stuff</button>
<div id="results"></div>

JavaScript

var json;
var $res = document.getElementById('results');
var $getBtn = document.getElementById('getStuff');

$getBtn.addEventListener

fetch('https://jsonplaceholder.typicode.com/todos/1')
  .then(response => response.json())
  .then(json => {
  
  var results
  for (var idx = 0, jsnl = json.length; idx < jsnl; idx++) {
  
  result += json[idx];
  
  }
  
 console.log(results);
  
  
  });