Skip to content

Commit fd8e6a7

Browse files
committed
Allow reverting back to the initial textarea (fixes sparksuite#142)
1 parent b6bee01 commit fd8e6a7

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ simplemde.codemirror.on("change", function(){
297297
});
298298
```
299299

300+
## Removing SimpleMDE from textarea
301+
You can revert to the initial textarea by calling the `toTextArea` method. Note that this clears up the autosave (if enabled) associated with it. The textarea will retain any text from the destroyed SimpleMDE instance.
302+
303+
```JavaScript
304+
var simplemde = new SimpleMDE();
305+
...
306+
simplemde.toTextArea();
307+
simplemde = null;
308+
```
309+
300310
## Useful methods
301311
The following self-explanatory methods may be of use while developing with SimpleMDE.
302312

0 commit comments

Comments
 (0)