zoukankan      html  css  js  c++  java
  • jquery autocomplete 插件的使用

    Autocomplete 自动完成

    功能:输入框在输入关键字后,根据输入的内容给出相关的下拉框供用户选择,自动完成输入内容。
    插件:使用jqueryUI的自动完成小部件,文档地址:https://jqueryui.com/autocomplete/
    API:文档链接:https://api.jqueryui.com/autocomplete/#option-source

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>jQuery UI Autocomplete - Default functionality</title>
      <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
      <link rel="stylesheet" href="/resources/demos/style.css">
      <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
      <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
      <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>
    </head>
    <body>
     
    <div class="ui-widget">
      <label for="tags">Tags: </label>
      <input id="tags">
    </div>
     
     
    </body>
    </html>
    
  • 相关阅读:
    面试常见问题
    Servlet上传下载
    Java五大框架
    Jquery
    JavaEE
    Html学习
    JavaSE高级
    面向过程基础
    Java开发软件安装及配置
    JAVA的类加载机制和Class类
  • 原文地址:https://www.cnblogs.com/shellon/p/12838444.html
Copyright © 2011-2022 走看看