Show The Latest COVID-19 Stats Using JavaScript

Category: Javascript | March 28, 2020
Author:codeconcept
Views Total:603 views
Official Page:Go to website
Last Update:March 28, 2020
License:MIT

Preview:

Show The Latest COVID-19 Stats Using JavaScript

Description:

A pure JavaScript solution to show the live COVID-19 statistics (confirmed cases, recovered patients, and deaths) by country.

Based on https://covid19.mathdro.id/api.

See Also:

How to use it:

1. Create a select element from which the users can select a country to show the live updated stats of the Coronavirus (Covid-19).

<select name="countries" id="countries">
  <option value="all">World</option>
</select>

2. Create an empty container to hold the statistics.

<div class="country-stats"></div>

3. Put the main JavaScript index.js at the end of the document. That’s it.

<script src="./index.js" defer></script>

4. By default, the library uses Bootstrap 4 for the styling of the stats.

<link rel="stylesheet" href="/path/to/cdn/bootstrap.min.css" />

Changelog:

03/28/2020

  • JS update & bugfixed

You Might Be Interested In:


One thought on “Show The Latest COVID-19 Stats Using JavaScript

  1. Jildine B. Peñas

    Hi sir.. you have an API for Davao city or Davao region?

    Reply

Leave a Reply