Commit a5181b4b authored by Sander Kvenild's avatar Sander Kvenild
Browse files

Refactor

parent eaf68cfe
......@@ -4,16 +4,18 @@ fetch('fylkestopper.json')
.then(response => response.json())
.then(json => {
for (const peak of json) {
let fylke = document.createElement('td');
fylke.innerText = peak.fylke;
// creating HTML elements
let row = document.createElement('tr');
let fylke = document.createElement('td');
let navn = document.createElement('td');
navn.innerText = peak.navn;
let height = document.createElement('td');
// populating HTML elements
fylke.innerText = peak.fylke;
navn.innerText = peak.navn;
height.innerText = `${peak.høyde} m`;
let row = document.createElement('tr');
row.appendChild(fylke);
row.appendChild(navn);
row.appendChild(height);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment