From 7558199b49fed52f7e8ea0422ff654f6cda16baa Mon Sep 17 00:00:00 2001 From: MunawarAbbas313 <153192634+MunawarAbbas313@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:23:17 +0500 Subject: [PATCH] Update app.js --- CurrencyConverter/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CurrencyConverter/app.js b/CurrencyConverter/app.js index 6009ab0..181d03a 100644 --- a/CurrencyConverter/app.js +++ b/CurrencyConverter/app.js @@ -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"); @@ -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;