I was wondering if JavaScript records information about the prior events that occurred so that I could use the information to perform a specific course of action in the current event?
For example, I have an element that has an OnBlur event handler, but I would like to know the event that occurred prior to the OnBlur event that triggered the OnBlur event to occur, such as the user pressing the Tab key, arrow key, or mouse click that moved focus away from the element.
So does JavaScript provide any mechanism to facilitate access to the events history or can people throw ideas to me at good ways of implementing this?
There is nothing native in JS that does this..
You could just listen for the events you are interested in and append them to an array or whatever datastructure is useful to you. Then reference your own event database as needed.
So something like (JQuery assumed..)