How to use createLink to apply hyperlink on selected text using execCommand? I am creating a simple CMS editor.

Thanks