I spent several hours trying to figure this out. I wish the documentation was better or there were a built-in function for this (like getSelectedText). If you want to retrieve the selected html (not plain text), try this:
Hope I save someone else the pain I went through.
editor.getSelection().getNative().createRange().htmlText
Hope I save someone else the pain I went through.

Re: Answer: how to get selected html from chkeditor
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Re: Answer: how to get selected html from ckeditor
CKEDITOR.getSelectedHtml = function () { //note: next line works for IE, but not other browsers, so not using (createRange() not supported) //return editor.getSelection().getNative().createRange().htmlText; //assumes only one ckeditor on a page //find the iframe and see what is selected var iframe = $("td.cke_contents iframe"); var sel = iframe[0].contentDocument.getSelection(); if (sel.rangeCount > 0) { range = sel.getRangeAt(0); var clonedSelection = range.cloneContents(); return $("<div></div>").append(clonedSelection).html(); } else return ""; };