How do i change the default text in Google Maps API Places Autocomplete

落爺英雄遲暮 提交于 2019-12-12 02:49:02

问题


Is there a way to change the default text: "Enter a location" to 'Enter a Business Name' in Google Maps API Places Autocomplete?


回答1:


You change the placeholder attribute on the input element.

<input id="search" type="text" placeholder="Enter a Business Name" />



回答2:


In the input field itself, add a value attribute as in:

  <input id="searchTextField" type="text" size="50" value="foo">


来源:https://stackoverflow.com/questions/9108499/how-do-i-change-the-default-text-in-google-maps-api-places-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!