Q:

show alert when clicked inside the text editor

i have a text area where i'am applying CkEditor now i want to click inside the body and it should show me an alert but it does not work this is what i have so far
<textarea class="email_body_class" name="email_body"></textarea>

   var editor = CKEDITOR.replace('email_body', {
        allowedContent:true,
        removePlugins:"about",
        toolbar: [
            // {items: [ 'Bold', 'Italic', 'Underline' ] },
        ]
    });

        $('.email_body_class').on('click' ,function(){
         alert('Clicked on Body');
    });

https://jsfiddle.net/kunz/yjwep7mr/6/

A:

okay i managed to fix this i just added this code
CKEDITOR.on('instanceReady', function() {
    $('.cke_contents iframe').contents().click(function() {
        alert('Clicked!'); 
    });
});

https://jsfiddle.net/kunz/yjwep7mr/19/

