Jan 09, 2016
I presume this is on the browser?
The exact code very much depends on the Rich Text Editor you're using, i.e. how to interact with the text in the editor.
Hope this gets you started.