Wednesday, April 23, 2014

How do you set and get ckeditor value by javascript



How do you get data from ckeditor ?
use below code to get data from ckeditor , assume your editor name is 'description'

alert(CKEDITOR.instances.description.getData());

How do you set data in ckeditor ?
use below code to set data in ckeditor , assume your editor name is 'description'

CKEDITOR.instances.description.setData( '<h1>Hello Ubed Khan PHP programmer</h1>' );

1 comment:

  1. Thanks Ubed Khan. Your post resolved my issue which I was facing from many days.
    thanks

    ReplyDelete