I am currently researching the JSON and JS (JSON.parse()). Firstly, I need to write this text through JSON and then to show it with JavaScript in HTML in this format (as a list). I know how to show the first artist but don't know how to show the rest of them.
<html>
<body>
<h2>Artists</h2>
<div id="demo"></div>
<script>
var json =[{
"name": "Deep purple",
"title1": "Machine Head",
"title2": "Stormbringer"
},
{
"name": "Joe Satriani",
"title1": "Flying in a Blue Dream",
"title2": "The Extremist",
"title3": "Shockwave Supernova"
},
{
"name": "Snoop Dogg",
"title1": "The Doggfather",
"title2": "Snoopified"
}
];
var obj = JSON.parse(json);
document.getElementById("demo").innerHTML = '<ul><li>'+ obj[0].name+ '</li>'; //what now???
</script>
</body>
</html>