javascript/html autocomplete textbox

后端 未结 9 1396
我寻月下人不归
我寻月下人不归 2020-12-09 16:00

I am developing a web page which has a requirement of many autocomplete textboxes. As I am new to javascript, it is very tough for me to make my own autocomplete textbox. So

相关标签:
9条回答
  • 2020-12-09 16:34

    You can use dataList it is easy way for autocomplete text box

    0 讨论(0)
  • 2020-12-09 16:39

    If you are new to web development I'd recommend you to use jquery and jqueryUI package. The link above is to demo page where you can play with different types of datasources. I've copied an example which uses simple array as a datasource

    <script>
        $(function() {
            var availableTags = [
                "ActionScript",         "AppleScript",
                "Asp",              "BASIC",
                "C",                "C++",
                "Clojure",              "COBOL",
                "ColdFusion",           "Erlang",
                "Fortran",              "Groovy",
                "Haskell",              "Java",
                "JavaScript",           "Lisp",
                "Perl",             "PHP",
                "Python",               "Ruby",
                "Scala",                "Scheme"
            ];
            $( ".tags" ).autocomplete({
                source: availableTags
            });
        });
        </script>
    
    <div><input class="tags" type="text" /></div>
    <div><input class="tags" type="text" /></div>
    
    0 讨论(0)
  • 2020-12-09 16:44

    The AutoSuggest plugin has been deprecated and is now included in jQuery UI.

    Check this out:
    http://jqueryui.com/demos/autocomplete/

    0 讨论(0)
提交回复
热议问题