In this article I will explain with an example, how to implement the Google Places Autocomplete without using Google Maps.
In addition to this article will also explain how to use the Place changed event handler of the Google Autocomplete TextBox to get the selected place, its address and its location coordinates i.e. Latitude and Longitude.
Implementing Google Places Autocomplete without using Google Maps
The HTML Markup consists of an HTML TextBox using which the Google Places Autocomplete will be implemented.
The very first thing is to inherit the Google Maps API script along with the places library. Then inside the Google Maps window load event handler, the Google Places Autocomplete is applied to the TextBox and then the place_changed event handler is assigned to it.
The place_changed event handler is triggered when a place is selected in the Google Places Autocomplete TextBox. It first gets the selected place and then determines its address and its location coordinates i.e. Latitude and Longitude and then displays the details in JavaScript alert message box.
<html xmlns="">
    <style type="text/css">
            font-family: Arial;
            font-size: 10pt;
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        google.maps.event.addDomListener(window, 'load', function () {
            var places = new google.maps.places.Autocomplete(document.getElementById('txtPlaces'));
            google.maps.event.addListener(places, 'place_changed', function () {
                var place = places.getPlace();
                var address = place.formatted_address;
                var latitude =;
                var longitude = place.geometry.location.lng();
                var mesg = "Address: " + address;
                mesg += "\nLatitude: " + latitude;
                mesg += "\nLongitude: " + longitude;
    <input type="text" id="txtPlaces" style="width: 250px" placeholder="Enter a location" />
Google Autocomplete TextBox displaying places
Implement Google Places Autocomplete TextBox without Google Maps with Place changed event
JavaScript alert displaying the details of the selected place
Google Places AutoComplete example without using Maps