-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect.html
49 lines (44 loc) · 1.05 KB
/
select.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
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>DAM select demo</title>
</head>
<body>
<h1>DAM select demo</h1>
<p>DAM comes with a select widget. This widget provides a dropdown control where each
selection is associated with some data.</p>
<div id="installation"></div>
<script src="../dist/dam-plus-widgets-0.2.js"></script>
<script>
var div=DAM.maker("div"), p=DAM.maker("p"), span=DAM.maker("span"), button=DAM.maker("button");
var statusBar = span();
function updateStatus(msg) {
statusBar.innerHTML += "<p>selected " + msg + "</p>";
}
document.getElementById('installation').appendChild(
div(
DAM.makeSelect({
options: [
{
text: "First",
value: 1,
},
{
text: "Second",
value: 2,
selected: true
},
{
text: "Third",
value: 3,
}
],
onchange: function(option) {
updateStatus(option.value);
}
}),
statusBar
)
);
</script>
</body>