Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use click events in CKEditor..?

I am writing an small code to run on CKEditor document click event, but its not working. My code is,

var element = CKEDITOR.document.getById( 'Editor_TextArea' );
element.on( 'click', function( ev )
{
//mycode
   alert('ok');
  }
  );

Can anyone help me..

like image 286
Ramesh Avatar asked Jul 30 '12 11:07

Ramesh


1 Answers

That CKEDITOR.document.getById( 'Editor_TextArea' ); is not giving any values for me.. So i used the below code and its works well.

CKEDITOR.instances['Editor_TextArea'].on('contentDom', function() {
    this.document.on('click', function(event){
         //your code
         alert('Click Event');
     });
});
like image 182
Ramesh Avatar answered Oct 04 '22 16:10

Ramesh