title: Adding an onclick event to an image inside a Google Maps InfoWindow
body: <p>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.</p>
  
  <p>"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.</p>
  
  <p>My current code is:</p>
  
  <pre><code>var infowindow = new google.maps.InfoWindow({content: name + "&lt;/br&gt;" + "&lt;img
  onclick='output()' src='images/" + image +     
  "'style=height:100px;width:100px;float:none;&gt;"});
      google.maps.event.addListener(marker, 'click', function() {
      infowindow.open(map,marker);
      });
      function output()
      {
          $("#output").html("yes");
      }
  </code></pre>
  
  <p>And the HTML:
      </p>
  
  <pre><code>&lt;h1&gt;My First Google Map&lt;/h1&gt;
  
  &lt;div id="map" style="width:60%;height:500px"&gt;&lt;/div&gt;
  &lt;div id="output"&gt;&lt;/div&gt;
  
  
  
  &lt;/body&gt;
  </code></pre>