The code read-only property of the XPathException interface returns a short that contains one of the error code constants.


var exceptionCode = exception.code;


A short number representing the error code.


Specification Status Comment
Document Object Model (DOM) Level 3 XPath Specification
The definition of 'XPathException' in that specification.
Recommendation Initial definition

Browser compatibility

No compatibility data found. Please contribute data for "api.XPathException.code" (depth: 1) to the MDN compatibility data repository.

Document Tags and Contributors

Contributors to this page: mdnwebdocs-bot, Sebastianz
Last updated by: mdnwebdocs-bot,