5

i've got this error message in the console. can anyone explain why? and the page is running as it should be.

js?key=MyAPIKey&v=3.exp&libraries=places,drawing,geometry:32 InvalidValueError: not an instance of HTMLInputElement_.ab @ js?key=MyAPIKey&v=3.exp&libraries=places,drawing,geometry:32
New to Programming
  • 133
  • 1
  • 3
  • 13

3 Answers3

14
InvalidValueError: not an instance of `HTMLInputElement`

That's mean you have not set proper id of your html input element. Google API not able to find that control in your html code. Because of wrong id of input element.

If you using textarea then it will not work because google maps autocomplete now supports only window.HTMLInputElement(input tags)

For more details Please Check this Link

You can also find examples here of Google Map API

Community
  • 1
  • 1
Jaimin Soni
  • 1,061
  • 1
  • 13
  • 29
0

Add Google Api CDN after the callback function

eg.

function initMap() {
  //
}
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
Suraj Kumar
  • 5,547
  • 8
  • 20
  • 42
Rakesh Nandi
  • 141
  • 1
  • 5
0

I also got this error when i use google map autocomplete.

InvalidValueError: not an instance of `HTMLInputElement`

So i solve this as like .

var org = document.getElementById('origin');

 new google.maps.places.Autocomplete(org, options);
Fahim Akhtar
  • 359
  • 1
  • 4
  • 13