serg155alternate 2 anos atrás
pai
commit
8af286f821
2 arquivos alterados com 3 adições e 9 exclusões
  1. 0 5
      index.html
  2. 3 4
      script.js

+ 0 - 5
index.html

@@ -21,11 +21,6 @@
             <h3> Доступные валюты </h3>
             <div class="cur__wrapper">
             </div>
-
-            
-         
-          
-
             <div class="outer"> </div>
 
             <button class="btn"> Очистить </button>

+ 3 - 4
script.js

@@ -1,9 +1,7 @@
-let currency;
+
 const wrapper = document.querySelector('.cur__wrapper');
-//confirm('You want to see all currency names?') ? showCurencys() : exchange();
 
-function exchange() {
-    ///currency = prompt('enter currency for exchange (usd, eur, rub...etc)');
+function exchange(currency) {
     let url = 'https://open.er-api.com/v6/latest/' + currency.toUpperCase();
     if (currency.toLowerCase() === 'usd' || currency.toLowerCase() === 'eur' || currency.toLowerCase() === 'rub') {
         fetch(url)
@@ -37,4 +35,5 @@ function showCurencys() {
         });
     }
 
+
 showCurencys();