Twitter-style autocomplete in textarea

Martin Wiboe picture Martin Wiboe · May 27, 2011 · Viewed 49.1k times · Source

I am looking for a Javascript autocomplete implementation which includes the following:

  • Can be used in a HTML textarea
  • Allows for typing regular text without invoking autocomplete
  • Detects the @ character and starts autocomplete when it is typed
  • Loads list of options through AJAX

I believe that this is similar to what Twitter is doing when tagging in a tweet, but I can't find a nice, reusable implementation.
A solution with jQuery would be perfect.

Thanks.

Answer

Jernej Novak picture Jernej Novak · Mar 4, 2014

Another great library which solves this problem At.js (deprecated)

Source

Demo

They are now suggesting the Tribute library

https://github.com/zurb/tribute

Example