Demo 3 : Add/Remove NicEditors
The demo below shows toggling the display of NicEditors on both textarea and div elements. NicEdit instances can be added and removed at any time
Div Example
This is some TEST CONTENT
In a DIV Tag
Click the Buttons to activate
In a DIV Tag
Click the Buttons to activate
Textarea Example
Source Code
<div id="sample"> <h4> Div Example </h4> <div id="myArea1" style="width: 300px; height: 100px; border: 1px solid #000;"> This is some TEST CONTENT<br> In a DIV Tag<br> Click the Buttons to activate <br> <h4> Textarea Example </h4> <div> </div> <script> var area1, area2; function toggleArea1() { if(!area1) { area1 = new nicEditor({fullPanel : true}).panelInstance('myArea1',{hasPanel : true}); } else { area1.removeInstance('myArea1'); area1 = null; } } function addArea2() { area2 = new nicEditor({fullPanel : true}).panelInstance('myArea2'); } function removeArea2() { area2.removeInstance('myArea2'); } bkLib.onDomLoaded(function() { toggleArea1(); }); </script> </div>