JSFiddle - React, Tailwind, and code Playground

by Daniel Lizik

HTML

<button id="btn">click for an easy way to alert "styled" data from json format</button>

CSS

#btn {
    width:500px;
    height:45px;
}

JavaScript

var json = {
    one: "some prop",
    two: "another prop",
    three: "more props",
    four: {
        one: "nested prop"   
    }
}

var jsonString = JSON.stringify(json, null, 4).replace(/[\]\[\{\}\,\\"]*/g, "")

document.getElementById("btn").addEventListener("click", function() {
  alert(jsonString);
});