Home  >  Article  >  Web Front-end  >  JQuery gets or sets the data of ckeditor (sample code)_jquery

JQuery gets or sets the data of ckeditor (sample code)_jquery

WBOY
WBOYOriginal
2016-05-16 17:14:551276browse

When fetching data from CKEditor,

Copy code The code is as follows:

var data_tc = CKEDITOR.instances ['txt_editor_tc'].getData();

When setting data to CKEditor,
Copy code The code is as follows:

CKEDITOR.instances['txt_editor_sc'].setData('test');

These two lines of code are used to obtain CKEditor when using JQuery or JS Or used when setting CKEditor data.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn