JavaScript event sequence

瘦欲@ 提交于 2019-12-01 14:56:08

问题


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.


回答1:


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.




回答2:


I know a good german web site, also available in French I hope this helps:

http://de.selfhtml.org/javascript/sprache/eventhandler.htm




回答3:


W3C - Document Object Model Events - but as always... some browsers doesn't support everything.



来源:https://stackoverflow.com/questions/2103385/javascript-event-sequence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!