---
title: "compareDocumentPosition(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/domnode/comparedocumentposition(_:)"
---

# compareDocumentPosition(_:)

## Declaration

```swift
func compareDocumentPosition(_ other: DOMNode!) -> UInt16
```
