admin管理员组

文章数量:1426014

i am using tinyEditor as my text editor, but i donno how to get a tinyEditor textarea's value in javascript. when i user document.getElementById('texteditor').value; it gives me null. nothing. anyone know how to fix this problem?

this is the site for tinyEditor

i am using tinyEditor as my text editor, but i donno how to get a tinyEditor textarea's value in javascript. when i user document.getElementById('texteditor').value; it gives me null. nothing. anyone know how to fix this problem?

this is the site for tinyEditor

Share Improve this question edited Sep 7, 2013 at 12:50 Pars asked Aug 17, 2011 at 20:22 ParsPars 5,27211 gold badges59 silver badges91 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

Try this (editor is the instance):

editor.post();
var textAreaHtml = editor.t.value;

Well, the standard way is:

tinyMCE.get('element-ID').getContent();

which element-ID is the id of the textarea used for tinyMCE.

editor.i.contentWindow.document.body.innerHTML

this will return value of editor, but this is hack, this is not valid access, as I can see method for getting content doesn't exists.

so "editor" is name of your editor.

本文标签: tinymceget tinyEditor value in javascriptStack Overflow