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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -