Is this JSON formatted correctly? Why is it not displaying in the element with #id? I found a similar code snippet on https://www.sitepoint.com/colors-json-example/, copied and replaced the values but it's not functioning. Can anyone shed some light on this issue?
<p id="demo"></p>
<script>
{
"standing": [
{"code" : "G", "rank" : "1"},
{"code" : "I", "rank" : "2"},
{"code" : "M", "rank" : "3"},
{"code" : "X", "rank" : "4"},
{"code" : "A", "rank" : "5"},
{"code" : "B", "rank" : "6"},
{"code" : "C", "rank" : "7"},
{"code" : "D", "rank" : "8"},
{"code" : "E", "rank" : "9"}
]
}
document.getElementById("demo").innerHTML =
standing.code + " " + standing.rank;
</script>