How to insert text into a textarea using JavaScript without messing up edit history?
问题 Basically what i want is if a user selects some text in a textarea and presses ctrl + b then the text within the selection should be surrounded by stars. so basically what I want is : 1) textarea content : "hello this is some text" 2) user selects some text and presses ctrl + b "hello this is some text" (assume the bolded part is a text selection) 3) so I want the textarea content to be : "hello this *is some* text" 4) and if the user presses ctrl + z(or whatever the undo action) the textarea