Google Address Autocomplete on a form

Google Address Autocomplete on a form

How could I use the Google Address Autocomplete API for a standard Form?

I guess I can trigger a function by writing an On User Input script for a plain text field. But I'm not sure how to execute Java from a script.

This would be a cool feature if I can make it work.