views:

243

answers:

1

The jquery autocomplete provided by http://docs.jquery.com/Plugins/Autocomplete can work on a INPUT field or a TEXTAREA field. I have a use-case to make a DIV element act as a TEXTAREA by setting its attribute to contenteditable="true". Can I use the DIV's DOM handle for the autocompleter to behave as a textarea for the autocompleter. Currently the plugin 'as is' is not working for the DIV. What changes should I do for the plugin to work for all the above elements?

A: 

Tags on a page matter. If your div wants to act like a textarea, maybe it should be a textarea styled to look like a div. You can render your html in a separate div and position it on top of the text area.

Jonathan Julian