-
Notifications
You must be signed in to change notification settings - Fork 1
/
jquery.html
58 lines (56 loc) · 1.6 KB
/
jquery.html
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
<html>
<head>
<title>Autocomplete (jQuery example)</title>
<link href='css/main.css' rel='stylesheet' type='text/css'>
</head>
<body>
<h1>Simple Auto<span class="selected">complete</span></h1>
<p class="intro">A simple autocomplete that completes inside the input.</p>
<h2>Example</h2>
<p>You can try it with any of the following words:</p>
<ul id="wordslist">
<li>black</li>
<li>blue</li>
<li>blue dark</li>
<li>blue darker</li>
<li>green</li>
<li>green dark</li>
<li>green even darker</li>
<li>green light</li>
<li>grey similar to silver but darker</li>
<li>silver</li>
<li>yellow</li>
</ul>
<input type="text" name="" value="" placeholder="Insert text here" id="test">
<br><br>
<h2>Usage</h2>
<p>Autocomplete is agnostic but considers the availability of jQuery or Mootools,
so you can use it this way:</p>
<ul>
<li>Alone: <br><code>simpleAutocomplete(element, arrayOfWords)</code></li>
<li>jQuery: <br><code>$(element).simpleAutocomplete(arrayOfWords)</code></li>
<li>MooTools: <br><code>element.simpleAutocomplete(arrayOfWords)</code></li>
</ul>
<br><br>
<h2>License</h2>
<p>MIT Licensed</p>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="js/simpleAutocomplete.js"></script>
<script type="text/javascript">
var myStack = [
'black',
'blue',
'blue dark',
'blue darker',
'green',
'green dark',
'green even darker',
'green light',
'grey similar to silver but darker',
'silver',
'yellow'
]
$('#test').simpleAutocomplete(myStack).focus()
</script>
</body>
</html>