jQuery 入門教程 24 jQuery UI Autocomplete示例 二
阿新 • • 發佈:2018-11-08
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow
也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!
如果一個輸入框可以接受多個輸入項,比如選擇你喜歡的語言,以逗號隔開,這是也可以使用AutoComplete為每個輸入項提供輸入提示。不過此時除了設定資料來源外,還需要新增一些事件處理。
1 |
<!doctype html> |
2 |
< html lang = "en" > |
3 |
< head > |
4 |
< meta charset = "utf-8" /> |
5 |
< title >jQuery UI Demos</ title > |
6 |
< link rel = "stylesheet" href = "themes/trontastic/jquery-ui.css" /> |
7 |
< script src = "scripts/jquery-1.9.1.js" ></ script > |
8 |
< script src = "scripts/jquery-ui-1.10.1.custom.js" ></ script > |
9 |
10 |
< script > |
11 |
$(function () { |
12 |
var availableTags = [ |