-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautocomplete.htm
More file actions
63 lines (60 loc) · 1.66 KB
/
autocomplete.htm
File metadata and controls
63 lines (60 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!doctype html>
<html lang="ja">
<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">
<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"
];
//availableTags = [{label:"OKB:良品",value:"OKB"}, {label:"OKBA:良品x",value:"OKBA"}];
availableTags = ["OKB: 良品","OKBA: 良品","ABC: ","ACE: 中間","CD2: ","CE2: ","AF: "];
$( "#tags" ).autocomplete({
source: function( request, response ) {
var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( request.term ), "i" );
response( $.grep( availableTags, function( item ){
return matcher.test( item );
}));
},
minLength: 0,
autoFocus: true
});
$('#tags').focusin(function(e) {
$(this).autocomplete("search","");
});
} );
</script>
</head>
<body>
<div class="ui-widget">
<label for="tags">解析結果: </label>
<input id="tags">
</div>
</body>
</html>