I am working on a service which will allow editing of text. To aid the user in the process, I'd like to allow the user to set a text field to overwrite mode, as is possible in Word, etc. How can the behaviour of an HTML text box be changed to overwrite instead of insert text as the user types?
For example, if the textbox had the text:
This is a trst.
The user could click between the r and the t, type a single e
and the text would then be
This is a test.
with the cursor between the e
and the s
. I'm currently using jQuery, so methods using either that or pure javascript would be preferred. I would accept any reasonable solution, however.