0

My code

html: input type='text' name='Address_A' id='Address_1' placeholder='Nhập địa chỉ' autocomplete='off'
javascript:
var input = document.getElementById("Address_1");
            var autocomplete = new google.maps.places.Autocomplete(input, { types:['geocode'] });

            google.maps.event.addListener(autocomplete, 'place_changed', function () {

                var place = autocomplete.getPlace();
                input.value = name;
            });

but textbox is not show incorrect. Something wrong?

1
  • var place = autocomplete.getPlace() ; input.value = name; where is the variable name? Commented Nov 12, 2017 at 5:40

1 Answer 1

0

You can try on Google API doc The link is here with demo

https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

Cheers :D

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.