aboutsummaryrefslogtreecommitdiff
path: root/files/nl/dom/index.html
blob: 7caa501c325a3da610a4fcf36ae3b06f8862a731 (plain)
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
---
title: DOM
slug: DOM
tags:
  - DOM
translation_of: Web/API/Document_Object_Model
translation_of_original: DOM
---
<p>The <strong>Document Object Model (<em>DOM</em>)</strong> is a programming interface for HTML, XML and SVG documents. It provides a structured representation of the document (a tree) and it defines a way that the structure can be accessed from programs so that they can change the document structure, style and content. The DOM provides a representation of the document as a structured group of nodes and objects that have properties and methods. Nodes can also have event handlers attached to them, and once that event is triggered the event handlers get executed. Essentially, it connects web pages to scripts or programming languages.</p>

<p>Though often accessed using JavaScript, the DOM itself is not a part of the JavaScript language, and it can be accessed by other languages, though this is much less common.</p>

<p>An <a href="/en-US/docs/DOM/DOM_Reference/Introduction">introduction</a> to the DOM is available.</p>

<h2 id="DOM_interfaces">DOM interfaces</h2>

<div class="index">
<ul>
 <li>{{domxref("Attr")}}</li>
 <li>{{domxref("CharacterData")}}</li>
 <li>{{domxref("ChildNode")}} {{experimental_inline}}</li>
 <li>{{domxref("Comment")}}</li>
 <li>{{domxref("CustomEvent")}}</li>
 <li>{{domxref("Document")}}</li>
 <li>{{domxref("DocumentFragment")}}</li>
 <li>{{domxref("DocumentType")}}</li>
 <li>{{domxref("DOMError")}}</li>
 <li>{{domxref("DOMException")}}</li>
 <li>{{domxref("DOMImplementation")}}</li>
 <li>{{domxref("DOMString")}}</li>
 <li>{{domxref("DOMTimeStamp")}}</li>
 <li>{{domxref("DOMSettableTokenList")}}</li>
 <li>{{domxref("DOMStringList")}}</li>
 <li>{{domxref("DOMTokenList")}}</li>
 <li>{{domxref("Element")}}</li>
 <li>{{domxref("Event")}}</li>
 <li>{{domxref("EventTarget")}}</li>
 <li>{{domxref("HTMLCollection")}}</li>
 <li>{{domxref("MutationObserver")}}</li>
 <li>{{domxref("MutationRecord")}}</li>
 <li>{{domxref("Node")}}</li>
 <li>{{domxref("NodeFilter")}}</li>
 <li>{{domxref("NodeIterator")}}</li>
 <li>{{domxref("NodeList")}}</li>
 <li>{{domxref("ParentNode")}} {{experimental_inline}}</li>
 <li>{{domxref("ProcessingInstruction")}}</li>
 <li>{{domxref("Promise")}} {{experimental_inline}}</li>
 <li>{{domxref("PromiseResolver")}} {{experimental_inline}}</li>
 <li>{{domxref("Range")}}</li>
 <li>{{domxref("Text")}}</li>
 <li>{{domxref("TreeWalker")}}</li>
 <li>{{domxref("URL")}}</li>
 <li>{{domxref("Window")}}</li>
 <li>{{domxref("Worker")}}</li>
 <li>{{domxref("XMLDocument")}} {{experimental_inline}}</li>
</ul>
</div>

<h2 id="Obsolete_DOM_interfaces">Obsolete DOM interfaces</h2>

<p>The Document Object Model is being highly simplified. In order to achieve this the following interfaces present in the different DOM level 3 or earlier specification have been removed. It is still unclear if some may be reintroduced, but for the moment they have to be considered as obsolete and should be avoided:</p>

<div class="index">
<ul>
 <li>{{domxref("CDATASection")}}</li>
 <li>{{domxref("DOMConfiguration")}}</li>
 <li>{{domxref("DOMErrorHandler")}}</li>
 <li>{{domxref("DOMImplementationList")}}</li>
 <li>{{domxref("DOMImplementationRegistry")}}</li>
 <li>{{domxref("DOMImplementationSource")}}</li>
 <li>{{domxref("DOMLocator")}}</li>
 <li>{{domxref("DOMObject")}}</li>
 <li>{{domxref("DOMUserData")}}</li>
 <li>{{domxref("Entity")}}</li>
 <li>{{domxref("EntityReference")}}</li>
 <li>{{domxref("NamedNodeMap")}}</li>
 <li>{{domxref("NameList")}}</li>
 <li>{{domxref("Notation")}}</li>
 <li>{{domxref("TypeInfo")}}</li>
 <li>{{domxref("UserDataHandler")}}</li>
 <li> </li>
</ul>
</div>

<h2 id="HTML_interfaces">HTML interfaces</h2>

<p>A document containing HTML is described using the {{domxref("HTMLDocument")}} interface. Note that the HTML specification also extends the {{domxref("Document")}} interface.</p>

<p>An <code>HTMLDocument</code> object also gives access to browser features: the tab, or window, in which a page is drawn using the {{domxref("Window")}} interface, the {{domxref("window.style", "Style")}} associated to it (usually CSS), the history of the browser relative to the context, {{domxref("window.history", "History")}} , eventually a {{domxref("Selection")}} done on the document.</p>

<h3 id="HTML_element_interfaces">HTML element interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("HTMLAnchorElement")}}</li>
 <li>{{domxref("HTMLAppletElement")}}</li>
 <li>{{domxref("HTMLAreaElement")}}</li>
 <li>{{domxref("HTMLAudioElement")}}</li>
 <li>{{domxref("HTMLBaseElement")}}</li>
 <li>{{domxref("HTMLBodyElement")}}</li>
 <li>{{domxref("HTMLBRElement")}}</li>
 <li>{{domxref("HTMLButtonElement")}}</li>
 <li>{{domxref("HTMLCanvasElement")}}</li>
 <li>{{domxref("HTMLDataElement")}}</li>
 <li>{{domxref("HTMLDataListElement")}}</li>
 <li>{{domxref("HTMLDirectoryElement")}}</li>
 <li>{{domxref("HTMLDivElement")}}</li>
 <li>{{domxref("HTMLDListElement")}}</li>
 <li>{{domxref("HTMLElement")}}</li>
 <li>{{domxref("HTMLEmbedElement")}}</li>
 <li>{{domxref("HTMLFieldSetElement")}}</li>
 <li>{{domxref("HTMLFontElement")}}</li>
 <li>{{domxref("HTMLFormElement")}}</li>
 <li>{{domxref("HTMLFrameElement")}}</li>
 <li>{{domxref("HTMLFrameSetElement")}}</li>
 <li>{{domxref("HTMLHeadElement")}}</li>
 <li>{{domxref("HTMLHeadingElement")}}</li>
 <li>{{domxref("HTMLHtmlElement")}}</li>
 <li>{{domxref("HTMLHRElement")}}</li>
 <li>{{domxref("HTMLIFrameElement")}}</li>
 <li>{{domxref("HTMLImageElement")}}</li>
 <li>{{domxref("HTMLInputElement")}}</li>
 <li>{{domxref("HTMLKeygenElement")}}</li>
 <li>{{domxref("HTMLLabelElement")}}</li>
 <li>{{domxref("HTMLLegendElement")}}</li>
 <li>{{domxref("HTMLLIElement")}}</li>
 <li>{{domxref("HTMLLinkElement")}}</li>
 <li>{{domxref("HTMLMapElement")}}</li>
 <li>{{domxref("HTMLMediaElement")}}</li>
 <li>{{domxref("HTMLMenuElement")}}</li>
 <li>{{domxref("HTMLMetaElement")}}</li>
 <li>{{domxref("HTMLMeterElement")}}</li>
 <li>{{domxref("HTMLModElement")}}</li>
 <li>{{domxref("HTMLObjectElement")}}</li>
 <li>{{domxref("HTMLOListElement")}}</li>
 <li>{{domxref("HTMLOptGroupElement")}}</li>
 <li>{{domxref("HTMLOptionElement")}}</li>
 <li>{{domxref("HTMLOutputElement")}}</li>
 <li>{{domxref("HTMLParagraphElement")}}</li>
 <li>{{domxref("HTMLParamElement")}}</li>
 <li>{{domxref("HTMLPreElement")}}</li>
 <li>{{domxref("HTMLProgressElement")}}</li>
 <li>{{domxref("HTMLQuoteElement")}}</li>
 <li>{{domxref("HTMLScriptElement")}}</li>
 <li>{{domxref("HTMLSelectElement")}}</li>
 <li>{{domxref("HTMLSourceElement")}}</li>
 <li>{{domxref("HTMLSpanElement")}}</li>
 <li>{{domxref("HTMLStyleElement")}}</li>
 <li>{{domxref("HTMLTableElement")}}</li>
 <li>{{domxref("HTMLTableCaptionElement")}}</li>
 <li>{{domxref("HTMLTableCellElement")}}</li>
 <li>{{domxref("HTMLTableDataCellElement")}}</li>
 <li>{{domxref("HTMLTableHeaderCellElement")}}</li>
 <li>{{domxref("HTMLTableColElement")}}</li>
 <li>{{domxref("HTMLTableRowElement")}}</li>
 <li>{{domxref("HTMLTableSectionElement")}}</li>
 <li>{{domxref("HTMLTextAreaElement")}}</li>
 <li>{{domxref("HTMLTimeElement")}}</li>
 <li>{{domxref("HTMLTitleElement")}}</li>
 <li>{{domxref("HTMLTrackElement")}}</li>
 <li>{{domxref("HTMLUListElement")}}</li>
 <li>{{domxref("HTMLUnknownElement")}}</li>
 <li>{{domxref("HTMLVideoElement")}}</li>
</ul>
</div>

<h3 id="Other_interfaces">Other interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("CanvasRenderingContext2D")}}</li>
 <li>{{domxref("CanvasGradient")}}</li>
 <li>{{domxref("CanvasPattern")}}</li>
 <li>{{domxref("TextMetrics")}}</li>
 <li>{{domxref("ImageData")}}</li>
 <li>{{domxref("CanvasPixelArray")}}</li>
 <li>{{domxref("NotifyAudioAvailableEvent")}}</li>
 <li>{{domxref("HTMLAllCollection")}}</li>
 <li>{{domxref("HTMLFormControlsCollection")}}</li>
 <li>{{domxref("HTMLOptionsCollection")}}</li>
 <li>{{domxref("HTMLPropertiesCollection")}}</li>
 <li>{{domxref("DOMStringMap")}}</li>
 <li>{{domxref("RadioNodeList")}}</li>
 <li>{{domxref("MediaError")}}</li>
</ul>
</div>

<h3 id="Obsolete_HTML_interfaces">Obsolete HTML interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("HTMLBaseFontElement")}}</li>
 <li>{{domxref("HTMLIsIndexElement")}}</li>
</ul>
</div>

<h2 id="SVG_interfaces">SVG interfaces</h2>

<h3 id="SVG_element_interfaces">SVG element interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("SVGAElement")}}</li>
 <li>{{domxref("SVGAltGlyphElement")}}</li>
 <li>{{domxref("SVGAltGlyphDefElement")}}</li>
 <li>{{domxref("SVGAltGlyphItemElement")}}</li>
 <li>{{domxref("SVGAnimationElement")}}</li>
 <li>{{domxref("SVGAnimateElement")}}</li>
 <li>{{domxref("SVGAnimateColorElement")}}</li>
 <li>{{domxref("SVGAnimateMotionElement")}}</li>
 <li>{{domxref("SVGAnimateTransformElement")}}</li>
 <li>{{domxref("SVGCircleElement")}}</li>
 <li>{{domxref("SVGClipPathElement")}}</li>
 <li>{{domxref("SVGColorProfileElement")}}</li>
 <li>{{domxref("SVGComponentTransferFunctionElement")}}</li>
 <li>{{domxref("SVGCursorElement")}}</li>
 <li>{{domxref("SVGDefsElement")}}</li>
 <li>{{domxref("SVGDescElement")}}</li>
 <li>{{domxref("SVGElement")}}</li>
 <li>{{domxref("SVGEllipseElement")}}</li>
 <li>{{domxref("SVGFEBlendElement")}}</li>
 <li>{{domxref("SVGFEColorMatrixElement")}}</li>
 <li>{{domxref("SVGFEComponentTransferElement")}}</li>
 <li>{{domxref("SVGFECompositeElement")}}</li>
 <li>{{domxref("SVGFEConvolveMatrixElement")}}</li>
 <li>{{domxref("SVGFEDiffuseLightingElement")}}</li>
 <li>{{domxref("SVGFEDisplacementMapElement")}}</li>
 <li>{{domxref("SVGFEDistantLightElement")}}</li>
 <li>{{domxref("SVGFEFloodElement")}}</li>
 <li>{{domxref("SVGFEGaussianBlurElement")}}</li>
 <li>{{domxref("SVGFEImageElement")}}</li>
 <li>{{domxref("SVGFEMergeElement")}}</li>
 <li>{{domxref("SVGFEMergeNodeElement")}}</li>
 <li>{{domxref("SVGFEMorphologyElement")}}</li>
 <li>{{domxref("SVGFEOffsetElement")}}</li>
 <li>{{domxref("SVGFEPointLightElement")}}</li>
 <li>{{domxref("SVGFESpecularLightingElement")}}</li>
 <li>{{domxref("SVGFESpotLightElement")}}</li>
 <li>{{domxref("SVGFETileElement")}}</li>
 <li>{{domxref("SVGFETurbulenceElement")}}</li>
 <li>{{domxref("SVGFEFuncRElement")}}</li>
 <li>{{domxref("SVGFEFuncGElement")}}</li>
 <li>{{domxref("SVGFEFuncBElement")}}</li>
 <li>{{domxref("SVGFEFuncAElement")}}</li>
 <li>{{domxref("SVGFilterElement")}}</li>
 <li>{{domxref("SVGFilterPrimitiveStandardAttributes")}}</li>
 <li>{{domxref("SVGFontElement")}}</li>
 <li>{{domxref("SVGFontFaceElement")}}</li>
 <li>{{domxref("SVGFontFaceFormatElement")}}</li>
 <li>{{domxref("SVGFontFaceNameElement")}}</li>
 <li>{{domxref("SVGFontFaceSrcElement")}}</li>
 <li>{{domxref("SVGFontFaceUriElement")}}</li>
 <li>{{domxref("SVGForeignObjectElement")}}</li>
 <li>{{domxref("SVGGElement")}}</li>
 <li>{{domxref("SVGGlyphElement")}}</li>
 <li>{{domxref("SVGGlyphRefElement")}}</li>
 <li>{{domxref("SVGGradientElement")}}</li>
 <li>{{domxref("SVGHKernElement")}}</li>
 <li>{{domxref("SVGImageElement")}}</li>
 <li>{{domxref("SVGLinearGradientElement")}}</li>
 <li>{{domxref("SVGLineElement")}}</li>
 <li>{{domxref("SVGMarkerElement")}}</li>
 <li>{{domxref("SVGMaskElement")}}</li>
 <li>{{domxref("SVGMetadataElement")}}</li>
 <li>{{domxref("SVGMissingGlyphElement")}}</li>
 <li>{{domxref("SVGMPathElement")}}</li>
 <li>{{domxref("SVGPathElement")}}</li>
 <li>{{domxref("SVGPatternElement")}}</li>
 <li>{{domxref("SVGPolylineElement")}}</li>
 <li>{{domxref("SVGPolygonElement")}}</li>
 <li>{{domxref("SVGRadialGradientElement")}}</li>
 <li>{{domxref("SVGRectElement")}}</li>
 <li>{{domxref("SVGScriptElement")}}</li>
 <li>{{domxref("SVGSetElement")}}</li>
 <li>{{domxref("SVGStopElement")}}</li>
 <li>{{domxref("SVGStyleElement")}}</li>
 <li>{{domxref("SVGSVGElement")}}</li>
 <li>{{domxref("SVGSwitchElement")}}</li>
 <li>{{domxref("SVGSymbolElement")}}</li>
 <li>{{domxref("SVGTextElement")}}</li>
 <li>{{domxref("SVGTextPathElement")}}</li>
 <li>{{domxref("SVGTitleElement")}}</li>
 <li>{{domxref("SVGTRefElement")}}</li>
 <li>{{domxref("SVGTSpanElement")}}</li>
 <li>{{domxref("SVGUseElement")}}</li>
 <li>{{domxref("SVGViewElement")}}</li>
 <li>{{domxref("SVGVKernElement")}}</li>
</ul>
</div>

<h3 id="SVG_data_type_interfaces">SVG data type interfaces</h3>

<p>Here are the DOM API for data types used in the definitions of SVG properties and attributes.</p>

<div class="note">
<p><strong>Note:</strong> Starting in {{Gecko("5.0")}},the following SVG-related DOM interfaces representing lists of objects are now indexable and can be accessed like arrays; in addition, they have a length property indicating the number of items in the lists: {{domxref("SVGLengthList")}}, {{domxref("SVGNumberList")}}, {{domxref("SVGPathSegList")}}, and {{domxref("SVGPointList")}}.</p>
</div>

<h4 id="Static_type">Static type</h4>

<div class="index">
<ul>
 <li>{{domxref("SVGAngle")}}</li>
 <li>{{domxref("SVGColor")}}</li>
 <li>{{domxref("SVGICCColor")}}</li>
 <li>{{domxref("SVGElementInstance")}}</li>
 <li>{{domxref("SVGElementInstanceList")}}</li>
 <li>{{domxref("SVGLength")}}</li>
 <li>{{domxref("SVGLengthList")}}</li>
 <li>{{domxref("SVGMatrix")}}</li>
 <li>{{domxref("SVGNumber")}}</li>
 <li>{{domxref("SVGNumberList")}}</li>
 <li>{{domxref("SVGPaint")}}</li>
 <li>{{domxref("SVGPoint")}}</li>
 <li>{{domxref("SVGPointList")}}</li>
 <li>{{domxref("SVGPreserveAspectRatio")}}</li>
 <li>{{domxref("SVGRect")}}</li>
 <li>{{domxref("SVGStringList")}}</li>
 <li>{{domxref("SVGTransform")}}</li>
 <li>{{domxref("SVGTransformList")}}</li>
</ul>
</div>

<h4 id="Animated_type">Animated type</h4>

<div class="index">
<ul>
 <li>{{domxref("SVGAnimatedAngle")}}</li>
 <li>{{domxref("SVGAnimatedBoolean")}}</li>
 <li>{{domxref("SVGAnimatedEnumeration")}}</li>
 <li>{{domxref("SVGAnimatedInteger")}}</li>
 <li>{{domxref("SVGAnimatedLength")}}</li>
 <li>{{domxref("SVGAnimatedLengthList")}}</li>
 <li>{{domxref("SVGAnimatedNumber")}}</li>
 <li>{{domxref("SVGAnimatedNumberList")}}</li>
 <li>{{domxref("SVGAnimatedPreserveAspectRatio")}}</li>
 <li>{{domxref("SVGAnimatedRect")}}</li>
 <li>{{domxref("SVGAnimatedString")}}</li>
 <li>{{domxref("SVGAnimatedTransformList")}}</li>
</ul>
</div>

<h3 id="SVG_Path_segment_interfaces">SVG Path segment interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("SVGPathSegList")}}</li>
 <li>{{domxref("SVGPathSeg")}}</li>
 <li>{{domxref("SVGPathSegArcAbs")}}</li>
 <li>{{domxref("SVGPathSegArcRel")}}</li>
 <li>{{domxref("SVGPathSegClosePath")}}</li>
 <li>{{domxref("SVGPathSegCurvetoCubicAbs")}}</li>
 <li>{{domxref("SVGPathSegCurvetoCubicRel")}}</li>
 <li>{{domxref("SVGPathSegCurvetoCubicSmoothAbs")}}</li>
 <li>{{domxref("SVGPathSegCurvetoCubicSmoothRel")}}</li>
 <li>{{domxref("SVGPathSegCurvetoQuadraticAbs")}}</li>
 <li>{{domxref("SVGPathSegCurvetoQuadraticRel")}}</li>
 <li>{{domxref("SVGPathSegCurvetoQuadraticSmoothAbs")}}</li>
 <li>{{domxref("SVGPathSegCurvetoQuadraticSmoothRel")}}</li>
 <li>{{domxref("SVGPathSegLinetoAbs")}}</li>
 <li>{{domxref("SVGPathSegLinetoHorizontalAbs")}}</li>
 <li>{{domxref("SVGPathSegLinetoHorizontalRel")}}</li>
 <li>{{domxref("SVGPathSegLinetoRel")}}</li>
 <li>{{domxref("SVGPathSegLinetoVerticalAbs")}}</li>
 <li>{{domxref("SVGPathSegLinetoVerticalRel")}}</li>
 <li>{{domxref("SVGPathSegMovetoAbs")}}</li>
 <li>{{domxref("SVGPathSegMovetoRel")}}</li>
</ul>
</div>

<h3 id="SMIL_related_interfaces">SMIL related interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("ElementTimeControl")}}</li>
 <li>{{domxref("TimeEvent")}}</li>
</ul>
</div>

<h3 id="Other_SVG_interfaces">Other SVG interfaces</h3>

<div class="index">
<ul>
 <li>{{domxref("SVGAnimatedPathData")}}</li>
 <li>{{domxref("SVGAnimatedPoints")}}</li>
 <li>{{domxref("SVGColorProfileRule")}}</li>
 <li>{{domxref("SVGCSSRule")}}</li>
 <li>{{domxref("SVGExternalResourcesRequired")}}</li>
 <li>{{domxref("SVGFitToViewBox")}}</li>
 <li>{{domxref("SVGLangSpace")}}</li>
 <li>{{domxref("SVGLocatable")}}</li>
 <li>{{domxref("SVGRenderingIntent")}}</li>
 <li>{{domxref("SVGStylable")}}</li>
 <li>{{domxref("SVGTests")}}</li>
 <li>{{domxref("SVGTextContentElement")}}</li>
 <li>{{domxref("SVGTextPositioningElement")}}</li>
 <li>{{domxref("SVGTransformable")}}</li>
 <li>{{domxref("SVGUnitTypes")}}</li>
 <li>{{domxref("SVGURIReference")}}</li>
 <li>{{domxref("SVGViewSpec")}}</li>
 <li>{{domxref("SVGZoomAndPan")}}</li>
</ul>
</div>

<h2 id="See_also" name="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/DOM/DOM_Reference/Examples">DOM Examples</a></li>
</ul>