How to reset textarea with summernote

After submitting, all fields in the form are cleared except TEXTAREA. I am using summernote for textarea. (using download)

<script type='text/javascript'>//<![CDATA[ $(function(){ $('#description').summernote({height: 500}); });//]]> </script> 

#description is an identifier for a text field.

reset done as below

 <script> $('#submit-box')[0].reset(); </script> 

#submit-box is the form id

+5
source share
2 answers
 $('#description').code(''); 

see http://hackerwins.imtqy.com/summernote/features.html#api-code

Update

Since summernote v0.6.4 + (possibly), the API breaks the changes.

 $('#description').summernote('code', ''); 

http://summernote.org/getting-started/#get-amp-set-code

+8
source

another way:

 $('#description').summernote('reset'); 
+4
source

Source: https://habr.com/ru/post/1204923/


All Articles