I am doing an exercise related with JSON and JavaScript. However, I just could not figure out that what's wrong with my syntax. It should show the links on the ordered list part in HTML, but I got only H2 tag.
Here is the syntax:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Javascript and jason</title>
</head>
<body>
<h2>Links</h2>
<ol id="links">
</ol>
<script>
var info = {
"full_name":"Ray Villaobos",
"title" : "Staff Author",
"links" :[
{"blog":"http://iviewsource.com"},
{"facebook":"http://facebook.com/iviewsource"},
{"youtube":"http://www.youtube.com"},
{"podcast":"http://feeds.feedburer.com/authoredcontent"},
{"twitter":"http://twitter.com/planetoftheweb"}
]
};
var output = '';
for (var i=0; i <=info.links.length; i++) {
for (key in info.links[i]){
if (info.links[i].hasOwnProperty(key))
{
output +='<li>' +
'<a href ="' + info.links[i][key]+
'">' +'</a>' +
'<li>';
}
}
}
var update = document.getElementById('links');
update.innerHtml = output;
</script>
</body>
</html>
<a>tag.