Detect if button click real user or triggered by a script

when a button click happens through the mouse, the event e usually has the mouse pointer location recorded. Try something like :

   if(e.screenX && e.screenX != 0 && e.screenY && e.screenY != 0){
     alert("real button click");
   }

Leave a Comment