title: How to hide Google Maps Api Markers with jQuery
body: <p>Hello this might be really silly question but I am trying to make markers disappear when
  they are clicked. The marker is located properly on the map but when I click it, it doesn't
  do anything. I was wondering why its not working. Thank you!</p>
  
  <pre><code>  &lt;script type="text/javascript" src="jQuery.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
  
    $(document).ready(function(){
        var myOptions = {
          center: new google.maps.LatLng(40.1, -88.2),
          zoom: 13,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
        var myLatlng = new google.maps.LatLng(40.1, -88.2);
        var temp_marker = new google.maps.Marker({
            position: myLatlng,
            map: map,
            title:"Hello World!"
          });
  
        console.log($(temp_marker));
        console.log(temp_marker);
  
        //temp_marker.click(function(){$(this).hide();});
  
        $(temp_marker).click(function(){console.log("click is working"); $(this).hide();});
            });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="map_canvas" style="width:100%; height:100%"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>