简体   繁体   English

在哪里可以找到 HTML 元素的可能事件列表?

[英]Where can I find a list of possible events for an HTML element?

I'd like to know the possible events that can come from an HTML span element.我想知道可能来自 HTML span 元素的事件。 Is there some documentation somewhere for each HTML element that says what events it can trigger and how?每个 HTML 元素的某个地方是否有一些文档说明它可以触发哪些事件以及如何触发?

The list below is the closest that I have found.. Not sure if it covers all of them!!下面的列表是我找到的最接近的列表。不确定它是否涵盖了所有这些!! Notice that there is no onChange event handler for the span tag.请注意,span 标记没有 onChange 事件处理程序。 Instead, you will have to use the MutationObserver to watch for changes being made to the DOM tree.相反,您必须使用MutationObserver来监视对 DOM 树所做的更改。

+----------------+--------------------------------------------------------------+
| Event          |onActivate                      onAfterUpdate                 |
| Handlers       |onBeforeActivate                onBeforeCopy                  |
|                |onBeforeCut                     onBeforeDeactivate            |
|                |onBeforeEditFocus               onBeforePaste                 |
|                |onBeforeUpdate                  onBlur                        |
|                |onClick                         onContextMenu                 |
|                |onControlSelect                 onCopy                        |
|                |onCut                           onDblClick                    |
|                |onDeactivate                    onDrag                        |
|                |onDragEnd                       onDragEnter                   |
|                |onDragLeave                     onDragOver                    |
|                |onDragStart                     onDrop                        |
|                |onErrorUpdate                   onFilterChange                |
|                |onFocus                         onFocusIn                     |
|                |onFocusOut                      onHelp                        |
|                |onKeyDown                       onKeyPress                    |
|                |onKeyUp                         onLoseCapture                 |
|                |onMouseDown                     onMouseEnter                  |
|                |onMouseLeave                    onMouseMove                   |
|                |onMouseOut                      onMouseOver                   |
|                |onMouseUp                       onMouseWheel                  |
|                |onMove                          onMoveEnd                     |
|                |onMoveStart                     onPaste                       |
|                |onPropertyChange                onReadyStateChange            |
|                |onResize                        onResizeEnd                   |
|                |onResizeStart                   onSelectStart                 |
|                |onTimeError                                                   |
+----------------+--------------------------------------------------------------+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM