I am trying to let the user change a infowindow in google maps - I am working with the code below. The document.getElementById("myInput").value
keeps returing null
.
Any ideas or other direction would be appreciate.
var domElement = document.createElement('div');
var input = document.createElement('input');
input.id="myInput";
input.type = "text";
input.value ="post";
document.body.appendChild(input);
postInfoWindow(marker, map, domElement);
post++;
});
function postInfoWindow(marker, map, description) {
marker.addListener('click', function() {
infowindow.setContent(description);
infowindow.open(map, this);
});
}
google.maps.event.addListener(infowindow, 'closeclick', function() {
var txt=document.getElementById("myInput").value; // RETURNS NULL
});
}