我创建了多个动态输入,并将这些输入分配给Google自动填充。我想在自动完成addListener中获取输入字段ID,以将其绑定到所选位置。有什么办法可以从自动完成获取输入字段ID?
function initialize(tagLocation) {
var autocomplete = new google.maps.places.Autocomplete(tagLocation);
autocomplete.addListener('place_changed', function() {
var obj = {
"palceId" : autocomplete.getPlace().place_id,
"name" : autocomplete.getPlace().name,
"address_components":autocomplete.getPlace().address_components,
"fieldId" : "How to get input field id here"
}
})
}