JSFiddle - React, Tailwind, and code Playground

by Anshuman Dwibhashi

HTML

<div id="demo"></div>

JavaScript

var x = document.getElementById("demo");
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        x.innerHTML = "Geolocation is not supported by this browser.";
    }
function showPosition(position) {
    x.innerHTML =  position.coords.heading +" "+ position.coords.speed;
}