You're trying to use a variable named employDesc
, you should use CKEDITOR.instances["employDesc"]
;
or just
$('.addVacancy').click( function() {
var editor = CKEDITOR.instances.employDesc;
if (editor) {
alert('instance exists');
editor.destroy(true);
alert('destroyed');
}
CKEDITOR.replace('employDesc');
});
It's the same that you were trying to do.