-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOM の章の確認問題を追加、内容のアップデート #725
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5d40b1c
DOMの各ステップに確認問題を追加
naka-12 be28997
DOMの章の冒頭でHTMLの雛形を提示
naka-12 bc2fad5
変数名elementをgreetingElementに修正
naka-12 9b1dbac
コードの省略への言及を削除
naka-12 a5efa33
textContent 書き換えの問題で差分だけ伝えるよう修正
naka-12 06f56a2
CSS ではなく JavaScript を使ってスタイルを操作することを明示
naka-12 f595c39
「要素を追加する」の確認問題をシンプルなものに変更
naka-12 5b75848
「要素を追加する」の確認問題を例題の続きに変更
naka-12 7fa8024
DOM要素の変数名をitemからelementに変更
naka-12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
docs/1-trial-session/13-dom/_samples/add-element-exercise/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
<ul id="packing-list"> | ||
<li>お弁当</li> | ||
<li>水筒</li> | ||
</ul> | ||
<script src="./script.js"></script> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
docs/1-trial-session/13-dom/_samples/add-element-exercise/script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const packingList = document.getElementById("packing-list"); | ||
|
||
const snackElement = document.createElement("li"); | ||
snackElement.textContent = "おやつ"; | ||
|
||
packingList.appendChild(snackElement); | ||
|
||
const capElement = document.createElement("li"); | ||
capElement.textContent = "帽子"; | ||
|
||
packingList.appendChild(capElement); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
const newItem = document.createElement("li"); | ||
newItem.textContent = "おやつ"; | ||
|
||
const packingList = document.getElementById("packing-list"); | ||
packingList.appendChild(newItem); | ||
|
||
const snackElement = document.createElement("li"); | ||
snackElement.textContent = "おやつ"; | ||
|
||
packingList.appendChild(snackElement); |
11 changes: 11 additions & 0 deletions
11
docs/1-trial-session/13-dom/_samples/change-styles/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
<div id="greeting">Hello World!</div> | ||
<script src="./script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const greetingElement = document.getElementById("greeting"); | ||
greetingElement.style.color = "yellow"; | ||
greetingElement.style.backgroundColor = "black"; |
11 changes: 11 additions & 0 deletions
11
docs/1-trial-session/13-dom/_samples/good-evening/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
<div>Good <strong id="greeting-type">morning</strong>!</div> | ||
<script src="./script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const greetingType = document.getElementById("greeting-type"); | ||
greetingType.textContent = "evening"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ
greeting-type
で英語的に合ってるんでしょうか?greeting-time
とかの方が良さそうに見えます。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://learn.utcode.net/docs/trial-session/functions/#引数
に倣いましたが、確かにそうですね……
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
greeting-type
だと有限のものの1つで、greeting-time
だと無限のもの(連続のもの)の1つという感覚を受けそうですね。今回だと
morning
、afternoon
、evening
みたいな感じで有限なもののどれかということを表しているので、greetingType
だと明確かなと思いました。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そしたらとりあえずこのままにします。問題があれば後で両方変えましょう