Include the following JS and CSS.
<script src="https://places.reformosoftware.com/places.js"></script> <link rel="stylesheet" href="https://places.reformosoftware.com/places.css" type="text/css">
Input elements with the class places will be converted to place selection fields automatically.
<input class="places" id="example1" placeholder="Search for a city, town, or village...">
Access the latitude longitude value after selection (undefined if not selected or field has been modified since selection).
document.getElementById("example1").dataset.latlng // '51.494310, -3.172238'