is there anyway of distinguishing between whether the button is clicked directly by a mouse or its click event has been triggered logically?

<input type="button" id="someID" value="dene" onclick="alert('something');" />

<input type="button" value="dene2" id ="someID2" onclick="document.getElementById('someID').click()" />

now guys i want some kind of thing : when you directly click on someID button, it wont do anything, but when you click on someID2 button, it will alert.

I deadly need this. please help.

i found it guys, here is the complete example, when you click the button, it will give you 0, when you click it with mouse it will give you 1 and when you click with mouse right button it will give you 2.




<script type="text/javascript">

//link and form elements do not need to be told to capture.
//Using the JavaScript syntax, we have to wait for the relevant
//part of the page to load before telling it to detect the event
//This is easiest done with a load event listener
window.onload = function () { document.links[0].onmousedown=alertBut; }

function alertBut( e, evElement ) {
  if( !e ) {
    if( window.event ) {
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
  if( typeof( e.which ) == 'number' ) {
    //Netscape compatible
    e = e.which;
  } else if( typeof( e.button ) == 'number' ) {
    e = e.button;
  } else {
    //total failure, we have no way of obtaining the button
  if( !evElement ) { evElement = this; }
  /* 'this' will exist if I have used object.onEventName = alertBut;
  If I have passed evElement from the onmouseup attribute,
  'this' will refer to window */
  window.alert( evElement + ' was clicked with button ' + e );


<a  id ="someID" onmouseup="alertBut(arguments[0],this)" href="whatever">dene bakalim</a>
    <input id="Button1" type="button" value="button" onclick="document.getElementById('someID').onmouseup();" />

the script part is taken from