In HTML input
of type text
I'd like to identify adding or removal of particular characters at their exact location.
E.g. predefined value of text input is string aa
. User manipulates the string, using all kinds of editing - striking Backspace
and Delete
keys, selects text and deletes it \ replaces by another text. The final result of the manipulation is string a
.
I'd like to know if:
- first
a
was removed - last
a
was removed - both
a
's were removed and newa
character was added
One of my ideas is assigning each character some kind of unique id that may be used to identify deletion of particular character, but i have difficulties implementing it.
I can use all kinds of Javascript tools and libraries for in-browser usage.