style.apply(editor.document);
var link = { text: 'Brochure Link', tag: 'http://www.example.com/brochure.php' };
var selection = editor.getSelection();
var ranges = selection.getRanges();
try {
range = ranges[0];
}
catch (e) {
return;
}
range.shrink(editor.SHRINK_TEXT);
// Create element if current selection is collapsed.
if (ranges.length == 1 && ranges[0].collapsed) {
var text = new window.parent.CKEDITOR.dom.text(link.text, editor.document);
ranges[0].insertNode(text);
ranges[0].selectNodeContents(text);
}
var style = new window.parent.CKEDITOR.style({ element: 'a', attributes: { href: link.tag} });
style.type = window.parent.CKEDITOR.STYLE_INLINE; // need to override... dunno why.
style.apply(editor.document);

Re: Applying anchor style to selected text in IE
Re: Applying anchor style to selected text in IE