Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiSijian authored Jun 5, 2024
1 parent 10c54b9 commit cbf4d75
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="module" src="./index.js"></script>
<script src="./index.js" defer></script>
<link rel="stylesheet" href="./style.css">
<title>board</title>
</head>

<body>
<button>board</button>
<input type="text" />
<textarea name="a" id="textarea"></textarea>
<input type="text"/>
</body>

</html>
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @ts-check
const input = document.querySelector('input')
const textarea=document.querySelector('textarea')
const textarea = document.querySelector('textarea')
input.addEventListener('keydown', (event) => {
const message = `${event.code}${event.key}`
textarea?.value=JSON.stringify(message)
textarea.value = JSON.stringify(message)
})
window.addEventListener('keydown', (event) => {
const message = `${event.code}${event.key}`
textarea?.value=JSON.stringify(message)
textarea.value = JSON.stringify(message)
})
3 changes: 3 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body{
background-color: #333333;
}

0 comments on commit cbf4d75

Please sign in to comment.