doc: create event object section
This commit is contained in:
1 parent
f799ebf3f1
commit
ac10edc2ac
1 file changed
+11
@@ -135,3 +135,14 @@ text"> <Go!>
|
|||||||
|
|
||||||
## 删除EventListener
|
## 删除EventListener
|
||||||

|

|
||||||
|
|
||||||
|
## 事件对象
|
||||||
|
事件处理函数可以附加到对象(窗口、DOM元素等)。
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
source.addEventListener("click", responseFunction);
|
||||||
|
function responseFunction(e) {
|
||||||
|
// we can access the click Event object here!
|
||||||
|
}
|
||||||
|
```
|
||||||
|
当事件发生时,将创建一个event对象并传递给事件侦听器。你可以"catch"此事件对象作为可选参数,以获取有关该事件的更多信息。
|
||||||
Reference in new issue
Block a user