Hi.
I'm using javascript and jQuery.
I have a textarea and 2 buttons to bold/underline the value of textarea.
My control: when user select text in textarea and click bold button, the text will be bold automatically.
I've done that.
Now, I want that: After user selects text and clicks bold button to bold text, it will automatic focus textarea and re-select the text.
function Bold()
{
$("#myarea").focus();
}
The main problem: if user wants to bold and underline the selected text, it needs to be selected once.
My map: Type text to textarea (handle) => select text (handle) => click bold button to bold the selected text (handle) => bold text (code) => auto focus textarea (code) => auto re-select the selected text (code) => click underline button (handle).
So, my main question: How to use javascript/jQuery to select the
custom text in textarea (not all text:
this.select())?
Sorry if this is not a clearly question.
Thank you!