These buttons demostrate textarea.insert . The values are appended to the text in the area at the caret's current position. If a user selection is present (drag or shift-select), then the value pairs wrap around the selection (like tags).
characters are encoded through encodeURIComponent, which is proven to be the best alternative to escape()