If your code doesn’t work or you’ve faced any error/problem, please download the source code files from the given download button. That’s all, now you’ve successfully built a Currency Converter App in HTML CSS & JavaScript. select-box select::-webkit-scrollbar-track` ĮxchangeRateTxt.innerText = "Something went wrong" * Import Google Font - Poppins 0 īox-shadow: 7px 7px 20px rgba(0, 0, 0, 0.05) Second, create a CSS file with the name of style.css and paste the given codes in your CSS file. Ĭurrency Converter App in JavaScript | CodingNepal You can also download the source code files of this Currency Converter from the given download button.įirst, create an HTML file with the name of index.html and paste the given codes in your HTML file. After creating these files just paste the following codes into your file. First, you need to create four Files: HTML, CSS & JavaScript Files. To create this project (Currency Converter in JavaScript). You might like this:Ĭurrency Converter App in JavaScript For flags, I used countryflags.io API to show the user-selected country flag. Once it’s done, for swapping the currency codes, I just reversed the “from” currency to “to” currency and then call the function. API returned an object of the all-country currency conversion rate of the user-selected “from” currency.įirst, I got the user selected “to” currency conversion rate, and then I calculate it with the user-entered amount and show it in the exchange rate text. Then I sent a get request to an exchange rate API by passing the user selected “from” currency code. Then in the script.js file, first, I created an options tag and added those currency codes inside each option tag using for-in loop and inserted these tags inside the select tag.Īfter this, I created a function and got the user-entered amount. In the JavaScript file (country-list.js), I stored all possible country code and their currency code as an object. Codes & Concepts Behind JavaScript Currency Converter App But before you go to copy-paste codes or download source files, let’s understand the main code and concepts behind creating this project. If you liked this JavaScript Currency Converter and want to get source codes or files, then you can get it from the bottom of this page. I hope you liked this project and also understood the codes. I tried to explain the main JavaScript line by written comments. In the video, you have seen the demo video of this currency converter and how I created it using HTML CSS & JavaScript.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |