Is there a way to extract the city and postal code from the Google Maps API? Here is my current code:
if (place.address_components) {
code = [place.address_components[0].types[0].postal_code];
alert(code);
document.getElementById('cityField').value = code;
}
However, when I try to run this code, it alerts null.
Any assistance would be greatly appreciated. Thank you in advance.