Demo 1 : Convert All Textareas

By calling the nicEditors.allTextareas() function the below example replaces all 3 textareas on the page with nicEditors. NicEditors will match the size of the editor window with the size of the textarea it replaced.

First Textarea


Second Textarea


Third Textarea

Source Code

  1. <div id="sample">
  2. <script type="text/javascript" src="//js.nicedit.com/nicEdit-latest.js"></script>
  3. <script type="text/javascript">
  4.  
  5. bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
  6. </script>
  7. <h4>
  8. First Textarea
  9. </h4>
  10. <textarea name="area1" cols="40"></textarea><br>
  11. <h4>
  12. Second Textarea
  13. </h4>
  14. <textarea name="area2" style="width: 100%;"> Some Initial Content was in this textarea
  15. <h4>
  16. Third Textarea
  17. </h4>
  18. <textarea name="area3" style="width: 300px; height: 100px;"> HTML content default in textarea
  19. </div>