Slimen Tunis Slimen Tunis - 1 year ago 107
HTML Question

How to get the textarea value from jQuery LineControl Editor?

I'm using this jquery plugin to create a wysiwyg text editor,

I created a textarea where I want to display the text editor:

<textarea class="editor" rows="3" name="textEditor" id="textEditor"></textarea>

and then I called the jquery function:

<script type="text/javascript">
$(document).ready( function() {

Until now everything is working good, but when I wanted to know if the text is writed correctly or not by using this function:

function displayText(){

it gives me an empty text!

What am I missing ?

Answer Source

From the documentation of that plugin on Github, you need to use the getText option to retrieve the value of the editor. Try this:

function displayText(){