I'm trying to add an onclick event to an image inside an InfoWindow, so that when the image is clicked, a Javascript function is called.
"name" is the name of the place and "image" is the image location. They both show up fine when I click on the marker but nothing happens when I click on the image.
My current code is:
var infowindow = new google.maps.InfoWindow({content: name + "</br>" + "<img
onclick='output()' src='images/" + image +
"'style=height:100px;width:100px;float:none;>"});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
function output()
{
$("#output").html("yes");
}
And the HTML:
<h1>My First Google Map</h1>
<div id="map" style="width:60%;height:500px"></div>
<div id="output"></div>
</body>