title: how to find cause of function call
body: <p>this seems to be some wired question but i need to differentiate between this two.</p>
  
  <p>i have an function </p>
  
  <pre><code>function calculatePerDayRentCost(){
  //body
  }
  </code></pre>
  
  <p>and calling this function by two ways </p>
  
  <p>first(programmatically i means )</p>
  
  <pre><code>$('#qtyExtraDriver').change();
  </code></pre>
  
  <p>second (on changing value of dropdown)</p>
  
  <pre><code>&lt;select onchange="calculatePerDayRentCost()"&gt;
  &lt;option value="1"&gt;1&lt;/option&gt;
  &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;option value="3"&gt;3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>is there any way to differentiate in between function the cause of function call, that is programmatically or dropdown change. </p>