Wondering if this is even possible, but if I have a input containing text, for example lets say the word \'Test\' is in the input. What I would like to be able to do is change
You should take a look at how HTML WYSIWYG editors are build.
Basically, they
or
both ways are not trivial...