JSON - Outputting JSON data

0 votes
92 views
added Jul 24, 2019 in API by LC Marshal Captain (25,770 points)
<div id="demo"></div>

<script>
    var jsEl = {
        "name": "lcmarshal",
        "gender": "male"
    }
    var testEl = document.getElementById('demo');
    testEl.innerHTML = jsEl.name + ' ' + jsEl.gender;
</script>

//output: lcmarshal male

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...