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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -