如何更改Google Maps API地方自动填充功能中的默认文字

时间:2012-02-02 07:20:10

标签: google-maps google-maps-api-3 maps

有没有办法在Google Maps API Places Autocomplete中更改默认文字:“输入位置”为“输入商家名称”?

2 个答案:

答案 0 :(得分:5)

您可以更改输入元素上的占位符属性。

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

答案 1 :(得分:-1)

在输入字段本身中,添加一个值属性,如:

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