Add complete project
This commit is contained in:
parent
c449843941
commit
76725c3410
8 changed files with 144 additions and 0 deletions
10
js/continents.js
Normal file
10
js/continents.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
const continentList = document.getElementById("continent-list");
|
||||
fetch("https://countries.trevorblades.com/", { method: "POST", body: JSON.stringify({"query":"query allContinents { continents { name code }}","operationName":"allContinents"}), headers: { "Content-Type": "application/json" } }).then(response => response.json()).then(({data}) => {
|
||||
const continents = data.continents;
|
||||
document.getElementById("")
|
||||
for (const continent of continents) {
|
||||
const newListItem = document.createElement("li");
|
||||
newListItem.innerHTML = `<a href="/continent.html?code=${continent.code}"> ${continent.name} </a>`;
|
||||
continentList.append(newListItem);
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue