<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macOS: -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/browserAccessibilitySelectedTextRange()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)browserAccessibilitySelectedTextRange"
  },
  "title" : "browserAccessibilitySelectedTextRange()"
}
-->

# browserAccessibilitySelectedTextRange()

Returns the range of selected text in the element.

```
func browserAccessibilitySelectedTextRange() -> NSRange
```

## Return Value

The selection’s range. If there’s no selection, returns `(0,` <doc://com.apple.documentation/documentation/Foundation/NSNotFound-4qp9h>`)`.

---

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)