JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>
<head>
<script>
/** Converts numeric degrees to radians */
if (typeof(Number.prototype.toRad) === "undefined") {
  Number.prototype.toRad = function() {
    return this * Math.PI / 180;
  }
}
    
function displayDistance()
{

var R = 6371; // km
var dLat = (23.87284-23.76119).toRad();
var dLon = (90.39603-90.43491).toRad(); 
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + 
        Math.cos(23.76119.toRad()) * Math.cos(23.87284.toRad()) *
        Math.sin(dLon/2) * Math.sin(dLon/2); 
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
var d = R * c;
document.getElementById("demo").innerHTML=d;
}
</script>
</head>
<body>
<div id="demo"></div>
<button type="button" onclick="displayDistance()">Display Distance</button>

</body>
</html>