JSFiddle - React, Tailwind, and code Playground
by dru_zod
HTML
<div>
<input type="text" id="url" value="https://blackburn.openplace.directory/o/ServiceDirectoryService/v2/services" />
<input type="button" id="fetch" value="fetch" />
</div>
<div>
<textarea id="result" cols="50" rows="50">
</textarea>
</div>
JavaScript
document.getElementById('fetch').addEventListener("click", function() {
const url = document.getElementById('url').value;
fetch(url).then(function(response) {
response.json().then(function(json) {
document.getElementById('result').value = JSON.stringify(json, null, 4);
});
});
});