Мне нужно создать тег в марке Google map. У меня есть следующий код для отображения маркера карты Google. Мне нужно щелкнуть маркер, чтобы перейти на другую страницу.
function bindInfoWindow(marker, map, infoWindow, html) {
google.maps.event.addListener(marker, 'click', function() {
infoWindow.setContent(html);
infoWindow.open(map, marker);
document.getElementById('hid_place').value=html;
document.getElementById("loc_name").value=html;
// $("#serach_fun").show();
});
}
Как я могу сделать
// Create DOM element with JavaScript
var anchor = document.createElement("a");
// insert new element into the DOM structure (as a child of another element)
marker.appendChild(anchor);
// set element attributes
anchor.innerHTML = "click here";
anchor.src = "http://www.site.ext/page.html";
Для получения дополнительной информации прочитайте метод HTML DOM createElement()