How to install nicedit uneditable

I use nicedit js, which is the WYSIWYG editor in my text box to view the html doc, but it is still editable, how to set this nicedit to readonly mode, I try to search from its document, but cannot find who -never have experience using nicedit,

early

+6
javascript nicedit
source share
6 answers

Here is a useful jQuery solution that I use with nicEdit:

jQuery('.nicEdit-main').attr('contenteditable','false'); jQuery('.nicEdit-panel').hide(); 

You can simply change it to true to make it editable again.

Note. I would think of switching the background color of the div along with this solution.

+6
source share

finally solution

var myNicEditor = new nicEditor (); myNicEditor.addInstance ('templateContent'); nicEditors.findEditor ("templateContent") disable ().

+3
source share

With the expression nicEditors.findEditor("TextArea").disable(); niceditor nicEditors.findEditor("TextArea").disable(); niceditor not editable But

 nicEditors.findEditor("TextArea").attr("contentEditable","true"); 

doesn't make it editable again

+1
source share

only worked for me:

 document.getElementsByClassName('nicEdit-main')[0].removeAttribute('contentEditable'); 
+1
source share

I'm going to guess that this is a WYSIWYG editor.

Try it...

 document.getElementById('nicedit').removeAttribute('contentEditable'); 
0
source share

function edit () {

a = new nicEditor ({fullPanel: true}). panelInstance ('area5', {hasPanel: true}); }

No_edit () function {

a.removeInstance ('MASK5');
}

0
source share

All Articles