Is there a way to detect if an element was clicked by jQuery's click()?
bots, javascript, jquery
Solution
You want to identify that the click event has triggered through element click or through any js code, right?
In that case you can use "event" object returned by "click" event
You can use
event.hasOwnProperty('originalEvent')
above statement returns true if the event is triggered by clicking on target element else returns false
Problem
I'm not too sure if this is possible, but is there anyway of achieving this? I want to have some basic protection from scripts that will automatically register click events on my buttons, e.g.: pesky bots. I want to only allow clicks with the mouse, not clicks triggered by javascript itself. Any ideas or other methods of protection against this?