This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
49 lines (43 loc) · 1.42 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
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Lit-Element App</title>
<script type="module" src="/src/my-button.ts"></script>
</head>
<body>
<select id="select-size">
<option value="">Select size</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
</select>
<select id="select-color">
<option value="">Select color</option>
<option value="default">Default</option>
<option value="success">Success</option>
<option value="danger">Danger</option>
</select>
<my-button
id="button"
size="small"
color="default">
Button
</my-button>
<script>
addEventListener('DOMContentLoaded', () => {
const button = document.querySelector('#button');
const selectSize = document.querySelector('#select-size');
const selectColor = document.querySelector('#select-color');
selectSize.addEventListener('change', event => {
button.setAttribute('size', event.target.value )
})
selectColor.addEventListener('change', event => {
button.setAttribute('color', event.target.value )
})
})
</script>
</body>
</html>