-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventsAndEventObject-HTML.txt
More file actions
432 lines (403 loc) · 11.1 KB
/
EventsAndEventObject-HTML.txt
File metadata and controls
432 lines (403 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
#---------------------------------------------------------------------
# Find and Replace Regexs for DOM Four Column Tables
#---------------------------------------------------------------------
Get rid of headers
<tr>\n.*?Event</th>\n.*?\n.*?\n.*?\n.*</tr>\n
Replace with
Get rid of DOM Element
.*?<td>\d</td>\n
Replace with
Get rid of non-existent DOM Elemnt
.*?<td> </td>\n
Replace with
Get rid of line breaks with a single <td> element
(doesn't work for all of them)
ctrl-, .*?\w
up-arrow
ctrl-j; backspace # combines lines
Combine three lines into one tabular row
.*?<tr>\n.*?<td>(.*?)</td>\n.*?<td>(.*?)</td>\n.*?<td>(.*?)</td>\n.*?</tr>
Replace with
$1 & $2 & \n \\parbox{widthc}{$3} \\\\
Edit <a href...
<a href="(.*?)">(.*?)</a>
Replace with
\\href{http://www.w3schools.com/jsref/$1}{$2}
Transform Section Headers
<h2>(.*?)</h2>\n
Replace with
\\bf{$1} \\\\ \\cline{1-1}
Get rid of <tables...
.*?<table.*?\n
Replace with
Get rid of <tables...
.*?</table\n
Replace with
#---------------------------------------------------------------------
<table class="reference" id="table2">
<tr>
<th width="20%" align="left">Event</th>
<th width="20%" align="left">Attribute</th>
<th width="54%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>keydown</td>
<td><a href="event_onkeydown.asp">onkeydown</a></td>
<td>The event occurs when the user is pressing a key or holding down a key</td>
<td>2</td>
</tr>
<tr>
<td>keypress</td>
<td><a href="event_onkeypress.asp">onkeypress</a></td>
<td>The event occurs when the user is pressing a key or holding down a key</td>
<td>2</td>
</tr>
<tr>
<td>keyup</td>
<td><a href="event_onkeyup.asp">onkeyup</a></td>
<td>The event occurs when a keyboard key is released</td>
<td>2</td>
</tr>
</table>
<h2>Frame/Object Events</h2>
<table class="reference">
<tr>
<th width="20%" align="left">Event</th>
<th width="20%" align="left">Attribute</th>
<th width="54%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>abort</td>
<td>onabort</td>
<td>The event occurs when an image is stopped from loading before
completely loaded (for <object>)</td>
<td>2</td>
</tr>
<tr>
<td>error</td>
<td>onerror</td>
<td>The event occurs when an image does not load properly (for <object>,
<body> and <frameset>)</td>
<td> </td>
</tr>
<tr>
<td>load</td>
<td><a href="event_onload.asp">onload</a></td>
<td>The event occurs when a document, frameset, or <object> has been loaded</td>
<td>2</td>
</tr>
<tr>
<td>resize</td>
<td><a href="event_onresize.asp">onresize</a></td>
<td>The event occurs when a document view is resized</td>
<td>2</td>
</tr>
<tr>
<td>scroll</td>
<td>onscroll</td>
<td>The event occurs when a document view is scrolled</td>
<td>2</td>
</tr>
<tr>
<td>unload</td>
<td><a href="event_onunload.asp">onunload</a></td>
<td>The event occurs when a document is removed from a window or frame (for
<body> and <frameset>)</td>
<td>2</td>
</tr>
</table>
<h2>Form Events</h2>
<table class="reference">
<tr>
<th width="20%" align="left">Event</th>
<th width="20%" align="left">Attribute</th>
<th width="54%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>blur</td>
<td><a href="event_onblur.asp">onblur</a></td>
<td>The event occurs when a form element loses focus</td>
<td>2</td>
</tr>
<tr>
<td>change</td>
<td><a href="event_onchange.asp">onchange</a></td>
<td>The event occurs when the content of a form element, the selection, or the
checked state have changed (for <input>, <select>, and <textarea>)</td>
<td>2</td>
</tr>
<tr>
<td>focus</td>
<td><a href="event_onfocus.asp">onfocus</a></td>
<td>The event occurs when an element gets focus (for <label>, <input>,
<select>, textarea>, and <button>)</td>
<td>2</td>
</tr>
<tr>
<td>reset</td>
<td>onreset</td>
<td>The event occurs when a form is reset</td>
<td>2</td>
</tr>
<tr>
<td>select</td>
<td><a href="event_onselect.asp">onselect</a></td>
<td>The event occurs when a user selects some text (for <input> and <textarea>)</td>
<td>2</td>
</tr>
<tr>
<td>submit</td>
<td>onsubmit</td>
<td>The event occurs when a form is submitted</td>
<td>2</td>
</tr>
</table>
<h2>Event Object</h2>
<h3>Constants</h3>
<table class="reference" id="table5">
<tr>
<th width="20%" align="left">Constant</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>AT_TARGET</td>
<td>The current event is in the target phase, i.e. it is being evaluated
at the event target (1)</td>
<td>2</td>
</tr>
<tr>
<td>BUBBLING_PHASE</td>
<td>The current event phase is the bubbling phase (2)</td>
<td>2</td>
</tr>
<tr>
<td>CAPTURING_PHASE</td>
<td>The current event phase is the capture phase (3)</td>
<td>2</td>
</tr>
</table>
<h3>Properties</h3>
<table class="reference">
<tr>
<th width="20%" align="left">Property</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td><a href="event_bubbles.asp">bubbles</a></td>
<td>Returns whether or not an event is a bubbling event</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_cancelable.asp">cancelable</a></td>
<td>Returns whether or not an event can have its default action prevented</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_currenttarget.asp">currentTarget</a></td>
<td>Returns the element whose event listeners triggered the event</td>
<td>2</td>
</tr>
<tr>
<td>eventPhase</td>
<td>Returns which phase of the event flow is currently being evaluated</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_target.asp">target</a></td>
<td>Returns the element that triggered the event</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_timestamp.asp">timeStamp</a></td>
<td>Returns the time (in milliseconds relative to the epoch) at which
the event was created</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_type.asp">type</a></td>
<td>Returns the name of the event</td>
<td>2</td>
</tr>
</table>
<h3>Methods</h3>
<table class="reference" id="table3">
<tr>
<th width="20%" align="left">Method</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>initEvent()</td>
<td>Specifies the event type, whether or not the event can bubble,
whether or not the event's default action can be prevented</td>
<td>2</td>
</tr>
<tr>
<td>preventDefault()</td>
<td>To cancel the event if it is cancelable, meaning that any default
action normally taken by the implementation as a result of the event
will not occur</td>
<td>2</td>
</tr>
<tr>
<td>stopPropagation()</td>
<td>To prevent further propagation of an event during event flow</td>
<td>2</td>
</tr>
</table>
<h2>EventTarget Object</h2>
<h3>Methods</h3>
<table class="reference" id="table4">
<tr>
<th width="20%" align="left">Method</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>addEventListener()</td>
<td>Allows the registration of event listeners on the event target (IE8
= attachEvent())</td>
<td>2</td>
</tr>
<tr>
<td>dispatchEvent()</td>
<td>Allows to send the event to the subscribed event listeners (IE8 =
fireEvent())</td>
<td>2</td>
</tr>
<tr>
<td>removeEventListener()</td>
<td>Allows the removal of event listeners on the event target (IE8 =
detachEvent())</td>
<td>2</td>
</tr>
</table>
<h2>EventListener Object</h2>
<h3>Methods</h3>
<table class="reference" id="table6">
<tr>
<th width="20%" align="left">Method</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>handleEvent()</td>
<td>Called whenever an event occurs of the event type for which the
EventListener interface was registered</td>
<td>2</td>
</tr>
</table>
<h2>DocumentEvent Object</h2>
<h3>Methods</h3>
<table class="reference" id="table7">
<tr>
<th width="20%" align="left">Method</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td>createEvent()</td>
<td> </td>
<td>2</td>
</tr>
</table>
<h2>MouseEvent/KeyboardEvent Object</h2>
<h3>Properties</h3>
<table class="reference">
<tr>
<th width="20%" align="left">Property</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">DOM</th>
</tr>
<tr>
<td><a href="event_altkey.asp">altKey</a></td>
<td>Returns whether or not the "ALT" key was
pressed when an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_button.asp">button</a></td>
<td>Returns which mouse button was clicked when an event
was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_clientx.asp">clientX</a></td>
<td>Returns the horizontal coordinate of the mouse pointer, relative to
the current window,
when an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_clienty.asp">clientY</a></td>
<td>Returns the vertical coordinate of the mouse pointer, relative to
the current window,
when an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_ctrlkey.asp">ctrlKey</a></td>
<td>Returns whether or not the "CTRL" key was pressed when
an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td>keyIdentifier</td>
<td>Returns the identifier of a key</td>
<td>3</td>
</tr>
<tr>
<td>keyLocation</td>
<td>Returns the location of the key on the advice</td>
<td>3</td>
</tr>
<tr>
<td><a href="event_metakey.asp">metaKey</a></td>
<td>Returns whether or not the "meta" key was pressed when an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_relatedtarget.asp">relatedTarget</a></td>
<td>Returns the element related to the element that triggered the event</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_screenx.asp">screenX</a></td>
<td>Returns the horizontal coordinate of the mouse pointer, relative to
the screen, when an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_screeny.asp">screenY</a></td>
<td>Returns the vertical coordinate of the mouse pointer, relative to
the screen, when an event was triggered</td>
<td>2</td>
</tr>
<tr>
<td><a href="event_shiftkey.asp">shiftKey</a></td>
<td>Returns whether or not the "SHIFT" key was pressed when an event was triggered</td>
<td>2</td>
</tr>
</table>
<h3>Methods</h3>
<table class="reference" id="table8">
<tr>
<th width="20%" align="left">Method</th>
<th width="74%" align="left">Description</th>
<th width="6%" align="left">W3C</th>
</tr>
<tr>
<td>initMouseEvent()</td>
<td>Initializes the value of a MouseEvent object</td>
<td>2</td>
</tr>
<tr>
<td>initKeyboardEvent()</td>
<td>Initializes the value of a KeyboardEvent object</td>
<td>3</td>
</tr>