Ave! How can I replace selected text with jquery? Let me have a text - "Eat my soft buns and snack with a dumpling." I highlight the word "soft" and click on the [ <b> ] button. The highlighted word is cut out and entered into the f-tion where tags are added to it and put in place of the flashing cursor. As a result, we have the html line: - " Съеш моих <b>мягких</b> булочек да закуси вареничком ".
I do not ask you to do everything for me as in TZ. I just need to specify the path by which to go in order to gain this knowledge.
Ps all buns 
Alt+Shift+W→ where the cursor blinked, enter the name of the tag. The tag itself will close for you. An example . Thank. - Sasha Chernykh