Skip to content

Commit 099f16a

Browse files
committed
Keyword Pressing project
1 parent 4d6cede commit 099f16a

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const insert = document.getElementById('insert')
2+
window.addEventListener('keydown', (e) => {
3+
insert.innerHTML = `
4+
<div class = 'color'>
5+
<table>
6+
<tr>
7+
<th>Key</th>
8+
<th>KeyCode</th>
9+
<th>Code</th>
10+
</tr>
11+
<tr>
12+
<td>${e.key === ' '? 'Space' : e.key}</td>
13+
<td>${e.keyCode}</td>
14+
<td>${e.code}</td>
15+
</tr>
16+
</table>
17+
</div>
18+
`
19+
})

0 commit comments

Comments
 (0)