---
title: selectedString()
framework: webkit
role: symbol
role_heading: Instance Method
path: webkit/webdocumenttext/selectedstring()
---

# selectedString()

Returns the currently selected text in the web document as a string.

## Declaration

```swift
func selectedString() -> String!
```

## Return Value

Return Value The currently selected text in the web document.

## See Also

### Selecting and deselecting text

- [selectAll()](webkit/webdocumenttext/selectall().md)
- [deselectAll()](webkit/webdocumenttext/deselectall().md)
- [selectedAttributedString()](webkit/webdocumenttext/selectedattributedstring().md)
