The Google Places Autocomplete API used to just use an <input> as the search field. So you could just add <input placeholder=”Search”>. Now the docs tell you to append a <gmp-place-autocomplete> element to your HTML div via javascript instead. I can’t find a way to add the placeholder text now.
This is what the docs say to do:
const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement();
const ACDiv = document.getElementById("search-field")
ACDiv.appendChild(placeAutocomplete);
placeAutocomplete.id = "place-autocomplete-input";
I have tried:
placeAutocomplete.placeholder = "Search"
placeAutocomplete.createPlaceholder("Search")
document.getElementById("place-autocomplete-input").placeholder = "Search
I can’t find anything online about this that refers to the NEW Places API. So I think I must be missing something obvious.
I’m using JS and Django if that makes a difference.