title: Google maps api Javascript add onclick to infowindow
body: <p>I tried to add onclick to my infowindow that after i'll click it it will show a larger infowindow. </p>
  
  <p>For now i'm trying only to show an alert but having trouble with it. </p>
  
  <p>This is my infowindow code:</p>
  
  <pre><code>google.maps.event.addListener(marker, 'click', (function (marker, i) {
             return function () {
                 var Name = locations[i][0];
                 infowindow.setContent(Name + '&lt;button onclick="markerCliked(Name)"&gt;Click&lt;/button&gt;');
                 infowindow.open(map, marker);
             }
         })(marker, i));
  </code></pre>
  
  <p>And my onclick function:</p>
  
  <pre><code>function markerCliked(Name){
      alert("Pressed on network " + Name);
  }
  </code></pre>
  
  <p>I'm getting an error that Name is not defined. </p>
  
  <p>What am i doing wrong?</p>