<!DOCTYPE html>
<html>
<head>
<title>Exercise one</title>
</head>
<body>
<div id="mountains"></div>
<script type="text/javascript">
const MOUNTAINS = [
{name: "Kilimanjaro", height: 5895, place: "Tanzania"},
{name: "Everest", height: 8848, place: "Nepal"},
{name: "Mount Fuji", height: 3776, place: "Japan"},
{name: "Vaalserberg", height: 323, place: "Netherlands"},
{name: "Denali", height: 6168, place: "United States"},
{name: "Popocatepetl", height: 5465, place: "Mexico"},
{name: "Mont Blanc", height: 4808, place: "Italy/France"}
];
function mountain(mountains) {
let row = document.createElement("tr"); // row of the table
let header = document.createElement("th"); // zagolovok table
let column = document.createElement("td");// columns of table
divTable = document.getElementById("mountains");
for (let elem of mountains){
divTable.appendChild(row.appendChild(document.createTextNode(elem.name)));
/*let another = divTable.appendChild(row.appendChild(document.createTextNode(elem.name)));*/
}
}
mountain(MOUNTAINS);
</script>