Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CurrencyConverter/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//Storing an APi in a Variable
const BASE_URL =
"https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies";

// Selecting the elements from the HTMl with querySelectors
const dropdowns = document.querySelectorAll(".dropdown select");
const btn = document.querySelector("form button");
const fromCurr = document.querySelector(".from select");
const toCurr = document.querySelector(".to select");
const msg = document.querySelector(".msg");

// Loop to iterate though the list
for (let select of dropdowns) {
for (currCode in countryList) {
let newOption = document.createElement("option");
Expand All @@ -24,7 +25,7 @@ for (let select of dropdowns) {
updateFlag(evt.target);
});
}

// fetching api and checking the input values
const updateExchangeRate = async () => {
let amount = document.querySelector(".amount input");
let amtVal = amount.value;
Expand Down