Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript event sequence

Some events in JavaScript fire before others. For example, with an input element, the keydown and keypress events fire first. Then, if the return value from those was not false, the input.value is updated. Then, the keyup event fires.

Is there a web site where I can find a comprehensive list of all events and the order in which they are executed, as well as other things that take place in between, such as updating the value in the input box in my example?

Such a list would be extremely helpful.

like image 671
Stephen Sorensen Avatar asked Jan 20 '10 17:01

Stephen Sorensen


People also ask

How do you prioritize events in JavaScript?

JavaScript events don't take any priorities. When and event is fired it is added to an event queue and executed as soon as possible. You can claim that it is a general rule that onclick attribut events will always trigger first, and that will always be true, but it's not because they are prioritized.


1 Answers

For key events, the following is an excellent resource: http://unixpapa.com/js/key.html. There's also a page for mouse events on the same site at http://unixpapa.com/js/mouse.html that I haven't used, but I imagine is useful based on the key events page.

like image 159
Tim Down Avatar answered Sep 22 '22 08:09

Tim Down