How to delete all instance of wysihtml5 editor

1.3k views Asked by At

I have an editor input for adding resume.When user click edit button the editor is loaded via ajax.Here is the code for loading editor:-

    jQuery('#resumeEditor').wysihtml5();

When the user clicks the cancel button and again tries to edit the resume, multiple editor toolbar appears. I think I have to delete all instance of editor.But I dont know how!

Any help appreciated.....

2

There are 2 answers

0
Annapurna On

This worked for me. Try it out:

    $('.wysihtml5-sandbox, .wysihtml5-toolbar').remove();
    $('#resumeEditor').show();

It removes the wysihtml5 and shows the textarea as it was before initializing.

0
BasicSide On

I had à similar problem and resolved with this code

  $("textarea").next().next().remove();
  $("textarea").prev().remove();
  $("textarea").css('display', 'block');

removing the HTML tags by hand, I tried to find some kind of function to remove and have not had succeed