I am using Google Autocomplete and am getting this error
InvalidValueError: not an instance of HTMLInputElement
I think Google has getElementById for deprication
var input = /** @type {!HTMLInputElement} */(
document.getElementById('pac-input'));
However i'm unsure on it's usage. My code below
var options ={
types:['(cities)'],
};
var input = document.getElementById('destination');
var autocomplete = new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window, 'load', initialize);
Use onFocus="functionName()"
which calls google.maps.autocomplete
on input tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With