简体   繁体   中英

autocomplete suggession in textarea on html tag

 <!DOCTYPE html> <html> <head> <base href="http://demos.telerik.com/kendo-ui/autocomplete/index"> <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style> <title></title> <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.412/styles/kendo.common-material.min.css" /> <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.412/styles/kendo.material.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://kendo.cdn.telerik.com/2015.3.1111/js/kendo.all.min.js"></script> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.common.min.css"> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.rtl.min.css"> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.default.min.css"> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.1111/styles/kendo.mobile.all.min.css"> <script src="http://kendo.cdn.telerik.com/2015.3.1111/js/angular.min.js"></script> <script src="http://kendo.cdn.telerik.com/2015.3.1111/js/jszip.min.js"></script> </head> <body> <div id="example"> <div class="demo-section k-content"> <h4>Choose shipping countries:</h4> <input id="countries" style="width: 100%;" /> <div class="demo-hint">Start typing the name of an European country</div> </div> <script> $(document).ready(function () { var data = [ "Albania", "Andorra", "Armenia", "Austria", "Azerbaijan", "Belarus", "Belgium", "Bosnia & Herzegovina", "Bulgaria", "Croatia", "Cyprus", "Czech Republic", "Denmark", "Estonia", "Finland", "France", "Georgia", "Germany", "Greece", "Hungary", "Iceland", "Ireland", "Italy", "Kosovo", "Latvia", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Malta", "Moldova", "Monaco", "Montenegro", "Netherlands", "Norway", "Poland", "Portugal", "Romania", "Russia", "San Marino", "Serbia", "Slovakia", "Slovenia", "Spain", "Sweden", "Switzerland", "Turkey", "Ukraine", "United Kingdom", "Vatican City" ]; //create AutoComplete UI component $("#countries").kendoAutoComplete({ dataSource: data, filter: "startswith", placeholder: "Select country...", separator: ", " }); }); </script> </div> </body> </html> 

It is worked fine but when I want to work for textarea it doesn't work.

$content

I designed a text editor for c code. so when a user write code on that textarea it will suggest snippet. what can i do for text area . please help........

try this

Introduces autocompleting power to textareas, like a GitHub comment form has.

https://github.com/yuku-t/jquery-textcomplete

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM