javascript - How to delete the selected text from CKEditor? -
i developing application using ckeditor. have provided button called clear. whenever user selects part of text , clicks on clear button selected text should deleted.
i used below code in application whenever user clicks on clear button not selected text whole content gets deleted.
function clear_onclick() { ckeditor.instances.message.setdata(''); }
how can clear selected text ckeditor on click of clear button in asp.net mvc2?
this job:
var range = ckeditor.instances.editor1.getselection().getranges()[ 0 ]; range.deletecontents(); range.select(); // select emptied range place caret in place.
Comments
Post a Comment