<s>
The	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
(	O
DOM	B-General_Concept
)	O
is	O
a	O
cross-platform	B-Operating_System
and	O
language-independent	B-Language
interface	O
that	O
treats	O
an	O
HTML	B-Language
or	O
XML	B-Protocol
document	I-Protocol
as	O
a	O
tree	B-Data_Structure
structure	I-Data_Structure
wherein	O
each	O
node	B-Data_Structure
is	O
an	O
object	O
representing	O
a	O
part	O
of	O
the	O
document	O
.	O
</s>
<s>
The	B-General_Concept
DOM	I-General_Concept
represents	O
a	O
document	O
with	O
a	O
logical	O
tree	O
.	O
</s>
<s>
Each	O
branch	O
of	O
the	O
tree	O
ends	O
in	O
a	O
node	B-Data_Structure
,	O
and	O
each	O
node	B-Data_Structure
contains	O
objects	O
.	O
</s>
<s>
DOM	B-General_Concept
methods	O
allow	O
programmatic	O
access	O
to	O
the	O
tree	O
;	O
with	O
them	O
one	O
can	O
change	O
the	O
structure	O
,	O
style	O
or	O
content	O
of	O
a	O
document	O
.	O
</s>
<s>
The	O
principal	O
standardization	O
of	O
the	B-General_Concept
DOM	I-General_Concept
was	O
handled	O
by	O
the	O
World	O
Wide	O
Web	O
Consortium	O
(	O
W3C	O
)	O
,	O
which	O
last	O
developed	O
a	O
recommendation	O
in	O
2004	O
.	O
</s>
<s>
WHATWG	B-Language
took	O
over	O
the	O
development	O
of	O
the	O
standard	O
,	O
publishing	O
it	O
as	O
a	O
living	O
document	O
.	O
</s>
<s>
The	O
W3C	O
now	O
publishes	O
stable	O
snapshots	O
of	O
the	O
WHATWG	B-Language
standard	O
.	O
</s>
<s>
In	O
HTML	B-General_Concept
DOM	I-General_Concept
(	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
)	O
,	O
every	O
element	B-General_Concept
is	O
a	O
node	B-Data_Structure
:	O
</s>
<s>
A	O
document	O
is	O
a	O
document	O
node	B-Data_Structure
.	O
</s>
<s>
All	O
HTML	B-General_Concept
elements	I-General_Concept
are	O
element	B-General_Concept
nodes	O
.	O
</s>
<s>
All	O
HTML	B-Language
attributes	O
are	O
attribute	O
nodes	O
.	O
</s>
<s>
Text	O
inserted	O
into	O
HTML	B-General_Concept
elements	I-General_Concept
are	O
text	O
nodes	O
.	O
</s>
<s>
The	O
history	O
of	O
the	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
is	O
intertwined	O
with	O
the	O
history	O
of	O
the	O
"	O
browser	B-Application
wars	I-Application
"	O
of	O
the	O
late	O
1990s	O
between	O
Netscape	B-Protocol
Navigator	I-Protocol
and	O
Microsoft	B-Application
Internet	I-Application
Explorer	I-Application
,	O
as	O
well	O
as	O
with	O
that	O
of	O
JavaScript	B-Language
and	O
JScript	B-Language
,	O
the	O
first	O
scripting	B-Language
languages	I-Language
to	O
be	O
widely	O
implemented	O
in	O
the	O
JavaScript	B-Language
engines	I-Language
of	O
web	B-Application
browsers	I-Application
.	O
</s>
<s>
JavaScript	B-Language
was	O
released	O
by	O
Netscape	O
Communications	O
in	O
1995	O
within	O
Netscape	B-Protocol
Navigator	I-Protocol
2.0	O
.	O
</s>
<s>
Netscape	O
's	O
competitor	O
,	O
Microsoft	O
,	O
released	O
Internet	B-Protocol
Explorer	I-Protocol
3.0	I-Protocol
the	O
following	O
year	O
with	O
a	O
reimplementation	O
of	O
JavaScript	B-Language
called	O
JScript	B-Language
.	O
</s>
<s>
JavaScript	B-Language
and	O
JScript	B-Language
let	O
web	B-Operating_System
developers	I-Operating_System
create	O
web	O
pages	O
with	O
client-side	B-Operating_System
interactivity	O
.	O
</s>
<s>
The	O
limited	O
facilities	O
for	O
detecting	O
user-generated	O
events	O
and	O
modifying	O
the	O
HTML	B-Language
document	O
in	O
the	O
first	O
generation	O
of	O
these	O
languages	O
eventually	O
became	O
known	O
as	O
"	O
DOM	B-General_Concept
Level	O
0	O
"	O
or	O
"	O
Legacy	O
DOM.	O
"	O
</s>
<s>
No	O
independent	O
standard	O
was	O
developed	O
for	O
DOM	B-General_Concept
Level	O
0	O
,	O
but	O
it	O
was	O
partly	O
described	O
in	O
the	O
specifications	O
for	O
HTML	B-Language
4	O
.	O
</s>
<s>
Legacy	O
DOM	B-General_Concept
was	O
limited	O
in	O
the	O
kinds	O
of	O
elements	O
that	O
could	O
be	O
accessed	O
.	O
</s>
<s>
Form	B-General_Concept
,	O
link	O
and	O
image	O
elements	O
could	O
be	O
referenced	O
with	O
a	O
hierarchical	O
name	O
that	O
began	O
with	O
the	O
root	O
document	O
object	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
form	B-General_Concept
input	O
element	B-General_Concept
could	O
be	O
accessed	O
as	O
either	O
document.formName.inputName	O
or	O
document.forms[0].elements[0]	O
.	O
</s>
<s>
The	O
Legacy	O
DOM	B-General_Concept
enabled	O
client-side	B-Operating_System
form	B-General_Concept
validation	O
and	O
simple	O
interface	O
interactivity	O
like	O
creating	O
tooltips	O
.	O
</s>
<s>
In	O
1997	O
,	O
Netscape	O
and	O
Microsoft	O
released	O
version	O
4.0	O
of	O
Netscape	B-Protocol
Navigator	I-Protocol
and	O
Internet	B-Application
Explorer	I-Application
respectively	O
,	O
adding	O
support	O
for	O
Dynamic	B-General_Concept
HTML	I-General_Concept
(	O
DHTML	B-General_Concept
)	O
functionality	O
enabling	O
changes	O
to	O
a	O
loaded	O
HTML	B-Language
document	O
.	O
</s>
<s>
DHTML	B-General_Concept
required	O
extensions	O
to	O
the	O
rudimentary	O
document	O
object	O
that	O
was	O
available	O
in	O
the	O
Legacy	O
DOM	B-General_Concept
implementations	O
.	O
</s>
<s>
Although	O
the	O
Legacy	O
DOM	B-General_Concept
implementations	O
were	O
largely	O
compatible	O
since	O
JScript	B-Language
was	O
based	O
on	O
JavaScript	B-Language
,	O
the	O
DHTML	B-General_Concept
DOM	B-General_Concept
extensions	O
were	O
developed	O
in	O
parallel	O
by	O
each	O
browser	B-Application
maker	O
and	O
remained	O
incompatible	O
.	O
</s>
<s>
These	O
versions	O
of	O
the	B-General_Concept
DOM	I-General_Concept
became	O
known	O
as	O
the	O
"	O
Intermediate	O
DOM	B-General_Concept
"	O
.	O
</s>
<s>
After	O
the	O
standardization	O
of	O
ECMAScript	B-Language
,	O
the	O
W3C	O
DOM	B-General_Concept
Working	O
Group	O
began	O
drafting	O
a	O
standard	O
DOM	B-General_Concept
specification	O
.	O
</s>
<s>
The	O
completed	O
specification	O
,	O
known	O
as	O
"	O
DOM	B-General_Concept
Level	O
1	O
"	O
,	O
became	O
a	O
W3C	O
Recommendation	O
in	O
late	O
1998	O
.	O
</s>
<s>
By	O
2005	O
,	O
large	O
parts	O
of	O
W3C	O
DOM	B-General_Concept
were	O
well-supported	O
by	O
common	O
ECMAScript-enabled	O
browsers	B-Application
,	O
including	O
Internet	B-Application
Explorer	I-Application
6	I-Application
(	O
from	O
2001	O
)	O
,	O
Opera	B-Application
,	O
Safari	B-Application
and	O
Gecko-based	O
browsers	B-Application
(	O
like	O
Mozilla	B-Language
,	O
Firefox	B-Application
,	O
SeaMonkey	B-Language
and	O
Camino	B-Language
)	O
.	O
</s>
<s>
The	O
W3C	O
DOM	B-General_Concept
Working	O
Group	O
published	O
its	O
final	O
recommendation	O
and	O
subsequently	O
disbanded	O
in	O
2004	O
.	O
</s>
<s>
Development	O
efforts	O
migrated	O
to	O
the	O
WHATWG	B-Language
,	O
which	O
continues	O
to	O
maintain	O
a	O
living	O
standard	O
.	O
</s>
<s>
In	O
2009	O
,	O
the	O
Web	O
Applications	O
group	O
reorganized	O
DOM	B-General_Concept
activities	O
at	O
the	O
W3C	O
.	O
</s>
<s>
In	O
2013	O
,	O
due	O
to	O
a	O
lack	O
of	O
progress	O
and	O
the	O
impending	O
release	O
of	O
HTML5	B-Application
,	O
the	B-General_Concept
DOM	I-General_Concept
Level	O
4	O
specification	O
was	O
reassigned	O
to	O
the	O
HTML	B-Language
Working	O
Group	O
to	O
expedite	O
its	O
completion	O
.	O
</s>
<s>
Meanwhile	O
,	O
in	O
2015	O
,	O
the	O
Web	O
Applications	O
group	O
was	O
disbanded	O
and	O
DOM	B-General_Concept
stewardship	O
passed	O
to	O
the	O
Web	O
Platform	O
group	O
.	O
</s>
<s>
Beginning	O
with	O
the	O
publication	O
of	O
DOM	B-General_Concept
Level	O
4	O
in	O
2015	O
,	O
the	O
W3C	O
creates	O
new	O
recommendations	O
based	O
on	O
snapshots	O
of	O
the	O
WHATWG	B-Language
standard	O
.	O
</s>
<s>
DOM	B-General_Concept
Level	O
1	O
provided	O
a	O
complete	O
model	O
for	O
an	O
entire	O
HTML	B-Language
or	O
XML	B-Protocol
document	I-Protocol
,	O
including	O
the	O
means	O
to	O
change	O
any	O
portion	O
of	O
the	O
document	O
.	O
</s>
<s>
DOM	B-General_Concept
Level	O
2	O
was	O
published	O
in	O
late	O
2000	O
.	O
</s>
<s>
It	O
introduced	O
the	O
getElementById	B-General_Concept
function	O
as	O
well	O
as	O
an	O
event	B-Application
model	I-Application
and	O
support	O
for	O
XML	B-Language
namespaces	I-Language
and	O
CSS	O
.	O
</s>
<s>
DOM	B-General_Concept
Level	O
3	O
,	O
published	O
in	O
April	O
2004	O
,	O
added	O
support	O
for	O
XPath	B-Language
and	O
keyboard	O
event	O
handling	O
,	O
as	O
well	O
as	O
an	O
interface	O
for	O
serializing	B-Application
documents	O
as	O
XML	B-Protocol
.	O
</s>
<s>
HTML5	B-Application
was	O
published	O
in	O
October	O
2014	O
.	O
</s>
<s>
Part	O
of	O
HTML5	B-Application
had	O
replaced	O
DOM	B-General_Concept
Level	O
2	O
HTML	B-Language
module	O
.	O
</s>
<s>
DOM	B-General_Concept
Level	O
4	O
was	O
published	O
in	O
2015	O
.	O
</s>
<s>
It	O
is	O
a	O
snapshot	O
of	O
the	O
WHATWG	B-Language
living	O
standard	O
.	O
</s>
<s>
To	O
render	B-Protocol
a	O
document	O
such	O
as	O
a	O
HTML	B-Language
page	O
,	O
most	O
web	B-Application
browsers	I-Application
use	O
an	O
internal	O
model	O
similar	O
to	O
the	B-General_Concept
DOM	I-General_Concept
.	O
</s>
<s>
The	O
nodes	O
of	O
every	O
document	O
are	O
organized	O
in	O
a	O
tree	B-Data_Structure
structure	I-Data_Structure
,	O
called	O
the	B-General_Concept
DOM	I-General_Concept
tree	O
,	O
with	O
the	O
topmost	O
node	B-Data_Structure
named	O
as	O
"	O
Document	O
object	O
"	O
.	O
</s>
<s>
When	O
an	O
HTML	B-Language
page	O
is	O
rendered	O
in	O
browsers	B-Application
,	O
the	O
browser	B-Application
downloads	O
the	O
HTML	B-Language
into	O
local	O
memory	O
and	O
automatically	O
parses	O
it	O
to	O
display	O
the	O
page	O
on	O
screen	O
.	O
</s>
<s>
However	O
,	O
the	B-General_Concept
DOM	I-General_Concept
does	O
not	O
necessarily	O
need	O
to	O
be	O
represented	O
as	O
a	O
tree	O
,	O
and	O
some	O
browsers	B-Application
have	O
used	O
other	O
internal	O
models	O
.	O
</s>
<s>
When	O
a	O
web	O
page	O
is	O
loaded	O
,	O
the	O
browser	B-Application
creates	O
a	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
of	O
the	O
page	O
,	O
which	O
is	O
an	O
object	O
oriented	O
representation	O
of	O
an	O
HTML	B-Language
document	O
that	O
acts	O
as	O
an	O
interface	O
between	O
JavaScript	B-Language
and	O
the	O
document	O
itself	O
.	O
</s>
<s>
This	O
allows	O
the	O
creation	O
of	O
dynamic	O
web	O
pages	O
,	O
because	O
within	O
a	O
page	O
JavaScript	B-Language
can	O
:	O
</s>
<s>
A	O
Document	B-General_Concept
Object	I-General_Concept
Model	I-General_Concept
(	O
DOM	B-General_Concept
)	O
tree	O
is	O
a	O
hierarchical	O
representation	O
of	O
an	O
HTML	B-Language
or	O
XML	B-Protocol
document	I-Protocol
.	O
</s>
<s>
It	O
consists	O
of	O
a	O
root	O
node	B-Data_Structure
,	O
which	O
is	O
the	O
document	O
itself	O
,	O
and	O
a	O
series	O
of	O
child	B-Data_Structure
nodes	I-Data_Structure
that	O
represent	O
the	O
elements	O
,	O
attributes	O
,	O
and	O
text	O
content	O
of	O
the	O
document	O
.	O
</s>
<s>
Each	O
node	B-Data_Structure
in	O
the	O
tree	O
has	O
a	O
parent	O
node	B-Data_Structure
,	O
except	O
for	O
the	O
root	O
node	B-Data_Structure
,	O
and	O
can	O
have	O
multiple	O
child	B-Data_Structure
nodes	I-Data_Structure
.	O
</s>
<s>
Elements	O
in	O
an	O
HTML	B-Language
or	O
XML	B-Protocol
document	I-Protocol
are	O
represented	O
as	O
nodes	O
in	O
the	B-General_Concept
DOM	I-General_Concept
tree	O
.	O
</s>
<s>
Each	O
element	B-General_Concept
node	B-Data_Structure
has	O
a	O
tag	B-General_Concept
name	O
,	O
attributes	O
,	O
and	O
can	O
contain	O
other	O
element	B-General_Concept
nodes	O
or	O
text	O
nodes	O
as	O
children	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
HTML	B-Language
document	O
with	O
the	O
following	O
structure:will	O
be	O
represented	O
in	O
the	B-General_Concept
DOM	I-General_Concept
tree	O
as	O
:	O
</s>
<s>
Text	O
content	O
within	O
an	O
element	B-General_Concept
is	O
represented	O
as	O
a	O
text	O
node	B-Data_Structure
in	O
the	B-General_Concept
DOM	I-General_Concept
tree	O
.	O
</s>
<s>
Text	O
nodes	O
do	O
not	O
have	O
attributes	O
or	O
child	B-Data_Structure
nodes	I-Data_Structure
,	O
and	O
are	O
always	O
leaf	O
nodes	O
in	O
the	O
tree	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
text	O
content	O
"	O
My	O
Website	O
"	O
in	O
the	O
title	O
element	B-General_Concept
and	O
"	O
Welcome	O
"	O
in	O
the	O
h1	O
element	B-General_Concept
in	O
the	O
above	O
example	O
are	O
both	O
represented	O
as	O
text	O
nodes	O
.	O
</s>
<s>
Attributes	O
of	O
an	O
element	B-General_Concept
are	O
represented	O
as	O
properties	O
of	O
the	O
element	B-General_Concept
node	B-Data_Structure
in	O
the	B-General_Concept
DOM	I-General_Concept
tree	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
element	B-General_Concept
with	O
the	O
following	O
HTML:will	O
be	O
represented	O
in	O
the	B-General_Concept
DOM	I-General_Concept
tree	O
as	O
:	O
</s>
<s>
The	B-General_Concept
DOM	I-General_Concept
tree	O
can	O
be	O
manipulated	O
using	O
JavaScript	B-Language
or	O
other	O
programming	O
languages	O
.	O
</s>
<s>
The	B-General_Concept
DOM	I-General_Concept
API	O
provides	O
a	O
set	O
of	O
methods	O
and	O
properties	O
to	O
perform	O
these	O
operations	O
,	O
such	O
as	O
getElementById	B-General_Concept
,	O
createElement	O
,	O
appendChild	O
,	O
and	O
innerHTML.Another	O
way	O
to	O
create	O
a	O
DOM	B-General_Concept
structure	O
is	O
using	O
the	O
innerHTML	O
property	O
to	O
insert	O
HTML	B-Language
code	I-Language
as	O
a	O
string	O
,	O
creating	O
the	O
elements	O
and	O
children	O
in	O
the	O
process	O
.	O
</s>
<s>
For	O
example:Another	O
method	O
is	O
to	O
use	O
a	O
JavaScript	B-Language
library	O
or	O
framework	O
such	O
as	O
jQuery	B-Language
,	O
AngularJS	B-Application
,	O
React	B-Application
,	O
Vue.js	B-Language
,	O
etc	O
.	O
</s>
<s>
These	O
libraries	O
provide	O
a	O
more	O
convenient	O
and	O
efficient	O
way	O
to	O
create	O
,	O
manipulate	O
and	O
interact	O
with	O
the	B-General_Concept
DOM	I-General_Concept
.	O
</s>
<s>
It	O
's	O
also	O
possible	O
to	O
create	O
a	O
DOM	B-General_Concept
structure	O
from	O
an	O
XML	B-Protocol
or	O
JSON	O
data	O
,	O
using	O
JavaScript	B-Language
methods	O
to	O
parse	O
the	O
data	O
and	O
create	O
the	O
nodes	O
accordingly	O
.	O
</s>
<s>
It	O
's	O
important	O
to	O
note	O
that	O
creating	O
a	O
DOM	B-General_Concept
structure	O
does	O
not	O
necessarily	O
mean	O
that	O
it	O
will	O
be	O
displayed	O
in	O
the	O
web	O
page	O
,	O
it	O
only	O
exists	O
in	O
memory	O
and	O
should	O
be	O
appended	O
to	O
the	O
document	O
body	O
or	O
a	O
specific	O
container	O
to	O
be	O
rendered	O
.	O
</s>
<s>
In	O
summary	O
,	O
creating	O
a	O
DOM	B-General_Concept
structure	O
involves	O
creating	O
individual	O
nodes	O
and	O
organizing	O
them	O
in	O
a	O
hierarchical	O
structure	O
using	O
JavaScript	B-Language
or	O
other	O
programming	O
languages	O
,	O
and	O
it	O
can	O
be	O
done	O
using	O
several	O
methods	O
depending	O
on	O
the	O
use	O
case	O
and	O
the	O
developer	O
's	O
preference	O
.	O
</s>
<s>
Because	O
the	B-General_Concept
DOM	I-General_Concept
supports	O
navigation	O
in	O
any	O
direction	O
(	O
e.g.	O
,	O
parent	O
and	O
previous	O
sibling	O
)	O
and	O
allows	O
for	O
arbitrary	O
modifications	O
,	O
an	O
implementation	O
must	O
at	O
least	O
buffer	O
the	O
document	O
that	O
has	O
been	O
read	O
so	O
far	O
(	O
or	O
some	O
parsed	O
form	B-General_Concept
of	O
it	O
)	O
.	O
</s>
<s>
Web	B-Application
browsers	I-Application
rely	O
on	O
layout	B-Protocol
engines	I-Protocol
to	O
parse	O
HTML	B-Language
into	O
a	O
DOM	B-General_Concept
.	O
</s>
<s>
Some	O
layout	B-Protocol
engines	I-Protocol
,	O
such	O
as	O
Trident/MSHTML	B-Application
,	O
are	O
associated	O
primarily	O
or	O
exclusively	O
with	O
a	O
particular	O
browser	B-Application
,	O
such	O
as	O
Internet	B-Application
Explorer	I-Application
.	O
</s>
<s>
Others	O
,	O
including	O
Blink	B-Language
,	O
WebKit	B-Language
,	O
and	O
Gecko	B-Language
,	O
are	O
shared	O
by	O
a	O
number	O
of	O
browsers	B-Application
,	O
such	O
as	O
Google	B-Application
Chrome	I-Application
,	O
Opera	B-Application
,	O
Safari	B-Application
,	O
and	O
Firefox	B-Application
.	O
</s>
<s>
The	O
different	O
layout	B-Protocol
engines	I-Protocol
implement	O
the	B-General_Concept
DOM	I-General_Concept
standards	O
to	O
varying	O
degrees	O
of	O
compliance	O
.	O
</s>
<s>
DOM	B-General_Concept
implementations	O
:	O
</s>
<s>
is	O
a	O
Server-side	O
(	O
Node.js	O
)	O
DOM	B-General_Concept
implementation	O
based	O
on	O
Mozilla	B-Language
's	O
dom.js	O
.	O
</s>
<s>
Domino	O
is	O
used	O
in	O
the	O
MediaWiki	B-Application
stack	O
with	O
Visual	O
Editor	O
.	O
</s>
<s>
is	O
a	O
simple	O
HTML	B-General_Concept
document	I-General_Concept
object	I-General_Concept
model	I-General_Concept
in	O
C#	O
,	O
which	O
can	O
generate	O
HTML	B-Language
string	O
programmatically	O
.	O
</s>
<s>
APIs	O
that	O
expose	O
DOM	B-General_Concept
implementations	O
:	O
</s>
