# Javascript: MisspelledWordCollection.remove Method

> Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: MisspelledWordCollection.remove Method
- **525 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/misspelledwordcollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/misspelledwordcollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/misspelledwordcollection/remove-method/llms-full.txt

---

### Description

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text.

### Syntax

```javascript
<void> MisspelledWordCollection.remove(<MisspelledWord> misspelledWord, <String> correctedText, <RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| misspelledWord | Specifies the misspelled word to remove. |
| correctedText | Specifies the corrected text. The current text of the word is replaced with this text. |
| callback | Receives whether the misspelled word could be removed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `MisspelledWordCollection.remove` in a practical document-editing workflow. It removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words and replaces the word's text with the specified text.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function remove(misspelledWords, misspelledWord) {
    misspelledWords.remove(
        misspelledWord,
        "Quarterly report",
        function(result) {
            if (result) {
                console.log("remove is available.");
            } else {
                console.warn("remove is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: MisspelledWordCollection.ignore Method](https://docs.textcontrol.com/ds-server/reference/javascript/misspelledwordcollection/ignore-method/llms-full.txt)
- **Next:** [MisspelledWordInfo Object](https://docs.textcontrol.com/ds-server/reference/javascript/misspelledwordinfo/llms-full.txt)
