JSFiddle - React, Tailwind, and code Playground

HTML

<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false"></script>
<script>
function getLatLng() {
    var geocoder = new google.maps.Geocoder();
    var address = document.getElementById('address').value;
    geocoder.geocode({
        'address': address
    }, function (results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            var latLng = results[0].geometry.location;
            $('#lat').val(results[0].geometry.location.lat());
            $('#lng').val(results[0].geometry.location.lng());
        } else {
            alert("Geocode was not successful for the following reason: " + status);
        }
    });
}
</script>
</head>
    <body>
        <div>
            <input id="address" type="textbox" value="Sydney, NSW">
            <input type="button" value="Geocode" onclick="getLatLng()">
            <input id="lat" type="textbox" value="lat">
            <input id="lng" type="textbox" value="lng">
           </div>
      </body>
</html>