Created
June 30, 2017 03:20
-
-
Save damien5314/1e4bbc8ad24b673c258fc5593f65f585 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>JSON Pretty Print</title> | |
</head> | |
<body> | |
<textarea id="input" rows="40" cols="64" placeholder="Paste JSON here"></textarea> | |
<textarea id="output" rows="40" cols="64" readonly="readonly" placeholder="Result"></textarea> | |
<br /> | |
<input type="submit" id="submit"> | |
<script> | |
function execute() { | |
var input = document.getElementById("input").value | |
var output = document.getElementById("output") | |
output.textContent = JSON.stringify(JSON.parse(input), null, 2) | |
} | |
document.getElementById("submit").onclick = execute | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment