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="http://js.nicedit.com/nicEdit-latest.js"></script> <script type="text/javascript">
  3. //<![CDATA[
  4. bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
  5. //]]>
  6. </script>
  7. <h4>
  8. First Textarea
  9. </h4>
  10. <textarea name="area1" cols="40">
  11. </textarea><br />
  12. <h4>
  13. Second Textarea
  14. </h4>
  15. <textarea name="area2" style="width: 100%;">
  16. Some Initial Content was in this textarea
  17. </textarea><br />
  18. <h4>
  19. Third Textarea
  20. </h4>
  21. <textarea name="area3" style="width: 300px; height: 100px;">
  22. HTML content default in textarea
  23. </textarea>
  24. </div>