I'm looking for an open source javascript / css widget that will display choices in a menu list below the edit field or let me type in my own text. Requirements:

  • I'm using contenteditable <div> elements.
  • The user should be able to select from the suggested options or type in their own text.
  • I'll be populating the list of suggestions with items that don't necessarily match anything the user is typing. No Google-style autosuggestion filtering, just show the list of options I give.
  • It's going in a Cordova (HTML5 / mobile) app; the solution needs to be cross-browser.
  • I'd rather not have to import an entire UI library for the widget; bonus points if the widget is standalone. :-)

I've come across a few options, but each of them needs to be hacked a bit:

Has anyone come across a library that's already made for contenteditable divs?

1 Answer 1


I'm not sure if it meets all your requirements, but Select2 may be worth investigating.

  • Thanks Teun! I poked around a bit with Select2, and it looks like it's more geared towards <select> elements. I'll probably end up going with Typeahead, as I was able to get it working with contenteditable divs. Here's the Gist: gist.github.com/eb1/39ed78cf52c6053fcb73
    – eb1
    Commented Feb 16, 2016 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.