0

im using the Jquery text editor plugin called JqueryTE

http://jqueryte.com/

for the moment im adding some functions to it but im stuck on one right now. Im trying to add a bit of text into the source of the textarea but it does not work.

It works with a normal textarea so its no problem there, but just this one that using jqueryTE are not working, im trying to look around in the code to find anyway to add some source into it but it does not work.

So in short, how could i add text to the textarea in a working way?

4
  • What is the question? i didn't find it..! Commented Feb 9, 2015 at 8:26
  • Edited the post, but the question is that how could i add text to the textarea ? Because it does not work with normal javascript .value = "xxx" to add any value to it. Commented Feb 9, 2015 at 8:30
  • You want to add some text into you text editor dynamically? After it has been rendered? Commented Feb 9, 2015 at 8:38
  • Yea exacly, i wanna build a function where you click the youtube icon in the menu bar (already added the icon),then a input box to appear where you paste the youtube link (already done) then add the full html to the textarea "<iframe and so on", thats where im trapped right now. Commented Feb 9, 2015 at 8:42

3 Answers 3

1

The actual texteditor window is a div with the class "jqte_editor".Something like this might help u mate.

$("#someTextArea").parent().parent().find(".jqte_editor").html("Sample text..")

Fiddle here

FYI

parent()

find()

Sign up to request clarification or add additional context in comments.

2 Comments

thanks! worked perfect mate, what is the parent() function if you could explain ?
I have updated the answer.Check the links mate.It will definitely help u.If you found the answer helpful do accept it.It might help other too..
1

You can use below code to update your text editor value.

$(".editor").jqteVal("New article!");

Read this link

Comments

0

just simply use

$("#someTextArea").text("Sample text");
$("#someTextArea").jqte();

DEMO

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.