doc: create event object section
This commit is contained in:
1 parent
928a325fb3
commit
bbe7970669
1 file changed
+12
-1
@@ -134,4 +134,15 @@ text"> <Go!>
|
||||

|
||||
|
||||
## 删除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