title: JavaScript: Get clicked element
body: <p>I need to get clicked element in function getClickedElement. How can I do this?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script&gt;
      function getClickedElement () {
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href="javascript:alert(getClickedElement())" id="test"&gt;click me!!!&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I can set only href attribute.
  I can not set onclick event because this elements is generated by third party lib.</p>
  
  <p>Thanks.</p>