title: Javascript Function being triggered by onClick check
body: <p>I was wondering if there is a way for a function to check if it was triggered by the onClick method?</p>
  
  <pre><code>function check(id) {
     if(onClick()) {
       alert('thanks for clicking!');
     }
  }
  </code></pre>
  
  <p>I've tried to find this but I can't seem to come across anything.
  Thanks!</p>