I have a textarea
and I would like to know how to detect the :
character and from there, show suggestions listed in an array with all the possibilities of "auto complete" and filter the results ...
Here is an example:
I already thought of detecting the :
character from keydown
using event keyCode
but I do not know how I would do it since in Windows I would have to detect shift
+ :
and on Mac I no longer know if it's the same thing. I also thought about only detecting the :
character from val()
of textarea
but I do not know how I could proceed.
What is the correct way to do this? And how to do it?
Preferably, I would really like to learn how to do only with jQuery and without the use of libraries.
Thanks!