I need to create a fake input so that i can change the content to be html elements.
Like in Desmos app you can type something like : a^b
and it will change to ab witch in html is:a<sup>b</sup
.
Also see the Monaco Editor that does syntax highlighting, autocomplete, etc.
I am familiar with contenteditable
attribute but in Demos they don't use it.
in both of these applications they implementing a fake input without using text area
, hidden input, or contenteditable
attribute.
So my question is how to achieve that behavior and implement a fake input with fake oninput, onblur, oncopy etc handler functions.