title: execute javascript code only when an element with specific id is clicked
body: <p>Is it possible to execute a block of javascript code when an element is clicked.</p>
  
  <pre><code>&lt;a id="id-name" href="#"&gt;ABC&lt;/a&gt;
  </code></pre>
  
  <p>I want to execute the following code only if above link is clicked</p>
  
  <pre><code>&lt;script&gt;
  if(link-clicked){
    var marker = new google.maps.Marker({
      position: new google.maps.LatLng( 12.1223, 123.324 ),
      map: map,
      title: Some Location
    });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Note: just pure javascript</p>