1
實例有一個HTML表單與此元素:谷歌Places API的InvalidValueError:不是HTMLInputElement
var control = container.getElementById('AutoComplete');
var input = /** @type {!HTMLInputElement} */ (control);
console.log("input: ", input); //Output: <input type="text" id="AutoComplete" placeholder="--" class="block_input" autocomplete="off">
autocomplete = new google.maps.places.Autocomplete(input, {
types: ['geocode']
});
<html>
<div id="input_address">
<div class="element">
<label class="block_label">Адрес</label>
</div>
<div class="element">
<input type="text" id="AutoComplete" placeholder="--" class="block_input"></input>
</div>
</div>
</html>
我有一個錯誤:
not an instance of HTMLInputElement
我怎麼能解決這個問題?
谷歌地圖自動完成被刪除,現在只支持window.HTMLInputElement – arunprakashpj
'新google.maps.places.Autocomplete'是異步的。調用構造函數後,輸入是否被銷燬/刪除/刪除? – cdm