Alexis Alexis - 4 years ago 105
jQuery Question

Creating a text editor through jquery

Well... Explanation is simple I want to create a text editor just like stackoverflow where you type and beneath the text is formatted and shown.

Lets keep the thing simple

This is a simple thing I tried.


But it doesn't push the text to the span.

Answer Source

As Amani said, you should use some external library, e.g. CKEditor or TineMCE. Then, bind on change event to replace the content of destination element.



<textarea name="editor"></textarea>

<div id="result">
    <p>Put some text in the editor to see the preview.</p>


var editor = CKEDITOR.replace('editor', {
    height: 100

editor.on('change', function () {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download