-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path33_async_Project2.html
More file actions
36 lines (35 loc) · 903 Bytes
/
33_async_Project2.html
File metadata and controls
36 lines (35 loc) · 903 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=
, initial-scale=1.0">
<title>Virtual Keyboard</title>
</head>
<body style="background-color: black; color: rgb(91, 151, 219); width: 100%;">
<div class="main" style="display: flex; justify-content: center;">
<div id="insert">
<div class="key">Press the key and watch the magic</div>
</div>
</div>
</body>
<script>
const insert = document.querySelector('#insert')
window.addEventListener('keydown' , (e) => {
insert.innerHTML = `
<div class = 'color'><table>
<tr>
<th>Key  </th>
<th>KeyCode  </th>
<th>Code  </th>
</tr>
<tr>
<td>${e.key}  </td>
<td>${e.keyCode}  </td>
<td>${e.code}  </td>
</tr>
<tr>
</div>`
})
</script>
</html>