JSFiddle - React, Tailwind, and code Playground

by Simon Raper

HTML

<script type="application/json" id="stuff">
    {
        "unicorns": "awesome",
        "abc": [1, 2, 3]
    }
</script>

<div id="test">
    
</div>

JavaScript

var stuff = document.getElementById('stuff').innerHTML;
var parsedStuff = JSON.parse(document.getElementById('stuff').innerHTML);

document.getElementById('test').innerHTML=stuff;

document.getElementById('test').innerHTML=parsedStuff.unicorns;