Name
DOMException
Properties
codeAn error code that provides some detail about what caused the exception. Some possible values (and their meanings) for this property are defined by the constants listed below.
Constants
The following constants define the code values that may be encountered by when
working with HTML documents. Note that these constants are static
properties of DOMException, not properties of individual exception
objects.
DOMException.INDEX_SIZE_ERR = 1Out-of-bounds error for an array or string index.
DOMException.HIERARCHY_REQUEST_ERR = 3An attempt was made to place a node somewhere illegal in the document tree hierarchy.
DOMException.WRONG_DOCUMENT_ERR = 4An attempt was made to use a node with a document other than the document that created the node.
DOMException.INVALID_CHARACTER_ERR = 5An illegal character was used (in an element name, for example).
DOMException.NOT_FOUND_ERR = 8A node was not found where it was expected.
DOMException.NOT_SUPPORTED_ERR = 9A method or property is not supported in the current DOM implementation.
DOMException.INUSE_ATTRIBUTE_ERR = 10An attempt was made to associate an Attr with an Element when that Attr node was already associated with a different Element node.
DOMException.SYNTAX_ERR = 12A syntax error occurred, such as in a CSS property specification.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access