Google Address autocomplete error

Hi,

I wanted to enable Google Address autocomplete and I’m having trouble setting it up. Blow is the flow I’m using to implement it.

Update below SCRIPT on Page Load event

and

But when I Page load, it gives me and error

I’m struggling with this so long and tried different ways to implement the autocomplete and still no luck on setting this up

To be specific I wanted to implement this Google Addresss auto-complete Place Autocomplete Address Form - JSFiddle - Code Playground