Skip to content

Commit 506d471

Browse files
課題に回答表示を追加
1 parent c065a55 commit 506d471

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="ja">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<div id="greeting"></div>
9+
<button id="button">ボタン</button>
10+
<script src="./script.js"></script>
11+
</body>
12+
</html>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const greetingElement = document.getElementById("greeting");
2+
const buttonElement = document.getElementById("button");
3+
4+
function onGreetingButtonClick() {
5+
greetingElement.textContent = "Hello world!!";
6+
greetingElement.style.color = "red";
7+
greetingElement.style.fontSize = "40px";
8+
}
9+
10+
buttonElement.onclick = onGreetingButtonClick;

docs/1-trial-session/14-events/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,5 @@ HTMLファイルに一工夫が必要です。見えない`<div>` タグを用
106106
```
107107

108108
</Details>
109+
110+
<ViewSource url={import.meta.url} path="_samples/" />

0 commit comments

Comments
 (0)