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 attri开发者_高级运维bute 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?
How to make jquery autocomplete to work for a contenteditable DIV instead of just INPUT, TEXTAREA fields.
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.
精彩评论