-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (40 loc) · 1.45 KB
/
index.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
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>chosen-readonly Test Page</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.6.2/chosen.min.css">
<style>
body{
padding: 20px 40px;
}
</style>
</head>
<body>
<h1>Testing chosen-readonly</h1>
<div style="width: 500px; margin: 20px;">
<select id="input1">
<option></option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
<button id="toggleReadonly" style="margin-left:10px;">Toggle Readonly</button>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.6.2/chosen.jquery.min.js"></script>
<script src="src/chosen-readonly.js"></script>
<script type="text/javascript">
$('select').chosen({width: '220px'});
var readonly = false;
$('button#toggleReadonly').click(function(){
readonly = !readonly;
$('select').chosenReadonly(readonly);
});
</script>
</body>
</html>