Determine whether a given JavaScript action has been initiated by user

Is it possible to determine whether a given JavaScript action has been initiated by user? For instance I want to know whether a link was clicked by user or via jQuery fire event method?

Answers:

Answer

event.which will be undefined if the event is triggered with code.

jsFiddle.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.