DOM
SourceIn all current engines.
Firefox44+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android44+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The createAttribute(localName)
method
steps are:
The createAttributeNS(namespace, qualifiedName)
method steps are:
In all current engines.
Firefox1+Safari1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The createEvent(interface)
method steps
are:
Event constructors ought to be used instead.
In all current engines.
Firefox1+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The createRange()
method steps are to return a new live range with (this, 0) as its start an end.
The Range()
constructor can be used instead.
In all current engines.
Firefox1+Safari3+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes
The createNodeIterator(root, whatToShow, filter)
method steps are:
In all current engines.
Firefox1+Safari3+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The createTreeWalker(root, whatToShow, filter)
method steps are:
User agents must create a DOMImplementation
object whenever
a document is created and associate it
with that document.
In all current engines.
Firefox1+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE6+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
[Exposed=Window]
interface DOMImplementation
{ [, , ); [, [, optional = null); [); boolean hasFeature(); // useless; always returns true
};
doctype = document . implementation
. createDocumentType(qualifiedName, publicId, systemId)
Returns a doctype, with the given qualifiedName, publicId, and systemId. If qualifiedName does not match the Name
production, an "InvalidCharacterError
" DOMException
is thrown, and if it does not match the QName
production, a "NamespaceError
" DOMException
is thrown. doc = document . implementation
. createDocument(namespace, qualifiedName [, doctype = null])
Returns an XMLDocument
, with a document element whose local name is qualifiedName and whose namespace is namespace (unless qualifiedName is the empty string), and with doctype, if it is given, as its doctype. This method throws the same exceptions as the createElementNS()
method, when invoked with namespace and qualifiedName.
doc = document . implementation
. createHTMLDocument([title])
Returns a document, with a basic tree already constructed including a title
element, unless the title argument is omitted. DOMImplementation/createDocumentType
In all current engines.
Firefox1+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The createDocumentType(qualifiedName, publicId, systemId)
method steps are:
No check is performed that publicId code points match the PubidChar
production or that systemId does not contain both a
'"
' and a "'
".
DOMImplementation/createDocument
In all current engines.
Firefox1+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The createDocument(namespace, qualifiedName, doctype)
method steps are:
DOMImplementation/createHTMLDocument
In all current engines.
Firefox4+Safari1+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The createHTMLDocument(title)
method steps are:
-
Let doc be a new document that is an HTML document.
-
Set doc’s content type to "
text/html
". -
Append a new doctype, with "
html
" as its name and with its node document set to doc, to doc. -
Append the result of creating an element given doc,
html
, and the HTML namespace, to doc. -
Append the result of creating an element given doc,
head
, and the HTML namespace, to thehtml
element created earlier. -
If title is given:
-
Append the result of creating an element given doc,
body
, and the HTML namespace, to thehtml
element created earlier. -
Return doc.
The hasFeature()
method steps are to
return true.
hasFeature()
originally would report whether the user agent
claimed to support a given DOM feature, but experience proved it was not nearly as
reliable or granular as simply checking whether the desired objects, attributes, or
methods existed. As such, it is no longer to be used, but continues to exist (and simply
returns true) so that old pages don’t stop working.
In all current engines.
Firefox1+Safari3+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
[Exposed=Window]
interface DocumentType
: Node { readonly attribute DOMString name; readonly attribute DOMString publicId; readonly attribute DOMString systemId;
};
DocumentType
nodes are simply known as doctypes.
Doctypes have an associated name, public ID, and system ID.
When a doctype is created, its name is always given. Unless
explicitly given when a doctype is created, its public ID and system ID are the
empty string.
The name
getter steps are to return this’s name.
The publicId
getter steps are to return this’s public ID.
The systemId
getter steps are to return this’s system ID.
In all current engines.
Firefox1+Safari3+Chrome1+ Opera8+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
[Exposed=Window]
interface DocumentFragment
: Node { constructor();
};
A DocumentFragment
node has an associated host (null or an element in a different node tree). It is null unless otherwise stated.
An object A is a host-including inclusive ancestor of an object B, if either A is an inclusive ancestor of B,
or if B’s root has a non-null host and A is a host-including inclusive ancestor of B’s root’s host.
Read Next page