JSFiddle - React, Tailwind, and code Playground

by Michel Penke

HTML

<html>
  <body>
    <button type="button" onclick="loadData()">Load Spreadsheet Data</button>
    <div id="display" contenteditable></div>
  </body>
</html>

https://stackoverflow.com/questions/16485255/how-do-you-import-data-from-a-google-sheets

https://www.codeproject.com/Articles/5266869/Getting-JavaScript-Object-Arrays-from-Google-Sheet

JavaScript

function loadData() {
  var url="https://docs.google.com/spreadsheets/d/1PGxJT_RKeJBC9XncgdmRGreig4luEsqPR55dvScTtlI/edit#gid=227830408&range=A1:B2";
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange = function() {
    if(xmlhttp.readyState == 4 && xmlhttp.status==200){
      document.getElementById("display").innerHTML = xmlhttp.responseText;
    }
  };
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}