Created
May 31, 2019 11:10
-
-
Save santarinto/5aa853f161e59b0ded85ac53e90ae942 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/guwoqur
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> | |
<head> | |
<meta name="description" content="[add your bin description]"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
textarea { | |
width: 100%; | |
min-height: 250px; | |
} | |
button { | |
margin-top: 3px; | |
margin-bottom: 3px; | |
width: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<textarea id="in"></textarea> | |
<button type="button" id="convert">convert</button> | |
<textarea id="out"></textarea> | |
<script id="jsbin-javascript"> | |
'use strict'; | |
var tin = document.getElementById('in'); | |
var cnvrt = document.getElementById('convert'); | |
var out = document.getElementById('out'); | |
var h = function h() { | |
out.value = ''; | |
var obj = JSON.parse(tin.value); | |
for (var k in obj) { | |
out.value += "+ " + k + ": "; | |
out.value += obj[k] + "\n"; | |
} | |
}; | |
cnvrt.addEventListener('click', h); | |
</script> | |
<script id="jsbin-source-css" type="text/css">textarea { | |
width: 100%; | |
min-height: 250px; | |
} | |
button { | |
margin-top: 3px; | |
margin-bottom: 3px; | |
width: 100%; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">const tin = document.getElementById('in'); | |
const cnvrt = document.getElementById('convert'); | |
const out = document.getElementById('out'); | |
const h = () => { | |
out.value = ''; | |
const obj = JSON.parse(tin.value); | |
for (let k in obj) { | |
out.value += "+ " + k + ": "; | |
out.value += obj[k] + "\n"; | |
} | |
}; | |
cnvrt.addEventListener('click', h);</script></body> | |
</html> |
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
textarea { | |
width: 100%; | |
min-height: 250px; | |
} | |
button { | |
margin-top: 3px; | |
margin-bottom: 3px; | |
width: 100%; | |
} |
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
'use strict'; | |
var tin = document.getElementById('in'); | |
var cnvrt = document.getElementById('convert'); | |
var out = document.getElementById('out'); | |
var h = function h() { | |
out.value = ''; | |
var obj = JSON.parse(tin.value); | |
for (var k in obj) { | |
out.value += "+ " + k + ": "; | |
out.value += obj[k] + "\n"; | |
} | |
}; | |
cnvrt.addEventListener('click', h); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment