-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavaSript.js
More file actions
28 lines (22 loc) · 718 Bytes
/
Copy pathjavaSript.js
File metadata and controls
28 lines (22 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var info = {
"full_name": "Siphiwe Malinga",
"title": "Web developer",
"links": {
"blog": "http://iviewsource.com",
"facebook": "http://facebook.com",
"youtube": "http://www.youtube.com",
"podcast": "http://feeds.feedburner.com",
"twitter": "http://twitter.com"
}
};
var output = "";
for (key in info.links) {
if (info.links.hasOwnProperty(key)) {
output += '<li>' +
'<a href = "' + info.links[key] +
'">' + key + '</a>' +
'</li>';
} //if the links has the key property
}// for in...go through each link
let update = document.getElementById("links");
update.innerHTML = output;