• Skip to main content
  • Skip to search
  • Skip to select language
MDN Logo
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. DOMException
  4. DOMException.code
  • Change language

Table of contents

  • Value
  • Specifications
  • Browser compatibility

DOMException.code

The code read-only property of the DOMException interface returns a short that contains one of the error code constants, or 0 if none match. This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the DOMException.name attribute.

Value

A short number.

Specifications

Specification
Web IDL Standard
# dom-domexception-code

Browser compatibility

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Mar 24, 2022, by MDN contributors

Change your language

Related Topics

  1. Document Object Model
  2. DOMException
  3. Constructor
    1. DOMException()
  4. Properties
    1. code
    2. message
    3. name
  5. Related pages for DOM
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. ByteString
    6. CDATASection
    7. CharacterData
    8. Comment
    9. CustomEvent
    10. DOMError
    11. DOMImplementation
    12. DOMParser
    13. DOMPoint
    14. DOMPointReadOnly
    15. DOMRect
    16. DOMTimeStamp
    17. DOMTokenList
    18. Document
    19. DocumentFragment
    20. DocumentType
    21. Element
    22. Event
    23. EventTarget
    24. HTMLCollection
    25. MutationObserver
    26. NamedNodeMap
    27. Node
    28. NodeFilter
    29. NodeIterator
    30. NodeList
    31. ProcessingInstruction
    32. Range
    33. StaticRange
    34. Text
    35. TextDecoder
    36. TextEncoder
    37. TimeRanges
    38. TreeWalker
    39. XMLDocument
MDN Logo
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2025 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies