I need a solution for change selected text inside a <textarea>.
In practice I want to select some text in <textarea>, and change the select text to, like: <b>selected text</b>:
This is the code for show what we see in attach image:
<textarea name="change" rows="4" cols="50">This is the text that can be selected. Words can be selected as a set of words.</textarea>
<a name="doit" id="doit" href="#">do it</a>
//change the selected text to something like:<b>selected text</b>
Is possible do this in js ot jquery and how?
The best regards, JC