The question is not clear. It's possible that you want edit not just text, but formatted text. Say, part of text would be bold, some other part have different font style of size, different indent, and so on.
Such editors are created based not on input control (what you call "textbox" is actually the input
element), but some element, such as
with the attribute
This is a good example of one of such products: open-source TinyMCE:
There are many more: https://en.wikipedia.org/wiki/Comparison_of_HTML_editors