<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebView-swift.class/selectedDOMRange",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebView(py)selectedDOMRange"
  },
  "title" : "selectedDOMRange"
}
-->

# selectedDOMRange

The range of the current selection.

```
var selectedDOMRange: DOMRange! { get }
```

## Discussion

`nil` if nothing is selected.

## See Also

[`func editableDOMRange(for: NSPoint) -> DOMRange!`](/documentation/WebKit/WebView-swift.class/editableDOMRange(for:))

Returns the editable DOM object located at a given point.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)