JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
<span>Location:</span>
<input type="text" id="txtAutocomplete" style="width: 300px" placeholder="Enter your address" />
<br />
<br />
<label id="lblResult" />
JavaScript
google.maps.event.addDomListener(window, 'load', initialize);
function initialize() {
debugger;
//var autocomplete = new google.maps.places.Autocomplete(document.getElementById("Kolkata,Westbengal,India"));
// google.maps.event.addListener(autocomplete, 'place_changed', function() {
// Get the place details from the autocomplete object.
var place = getPlace("Kolkata,Westbengal,India");
debugger;
var location = "<b>Address</b>: " + place.formatted_address + "<br/>";
location += "<b>Latitude</b>: " + place.geometry.location.lat() + "<br/>";
location += "<b>Longitude</b>: " + place.geometry.location.lng();
document.getElementById('lblResult').innerHTML = location
//});
}