-
Notifications
You must be signed in to change notification settings - Fork 3
DOM の課題の追加 #519
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
Merged
Merged
DOM の課題の追加 #519
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3e5f245
DOM の課題の改善
aster-void 8285ff1
chelproc氏 レビュー反映
aster-void e2a9152
DOM の「要素の追加」追加 (後で修正するかも)
aster-void abcf5b9
課題部分の修正
aster-void c97138c
演習のタイトルの修正
aster-void 4a26dc7
null消した (習ってない)
aster-void 8164e21
動かなかったです。
aster-void fde0d0c
戻り値 -> 返り値
aster-void 7043672
レビュー反映
aster-void 2db315a
レビュー反映
aster-void 8fe76e9
レビュー反映
aster-void 1fad898
レビュー反映 (一部保留)
aster-void 34e9c89
セーブ忘れ (上に付随)
aster-void a823ba1
改行追加
aster-void fab3055
id名変更
aster-void 0f48ecb
例にタイトル追加
aster-void db231a6
div -> button
aster-void d139b7a
語順修正
aster-void 316b8d1
chvmvd氏レビュー反映 (大きく改変)
aster-void fab0e55
button -> span
aster-void d4a18e7
内容違うので段落分離 (+format: 差分なし)
aster-void 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
15 changes: 15 additions & 0 deletions
15
docs/1-trial-session/13-dom/_samples/change-shopping-memo/index.html
This file contains hidden or 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,15 @@ | ||
<!doctype html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>買い物リスト</title> | ||
</head> | ||
<body> | ||
<ul> | ||
<li id="item1">トマト</li> | ||
<li id="item2">ナス</li> | ||
<li id="item3">バジル</li> | ||
</ul> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
3 changes: 3 additions & 0 deletions
3
docs/1-trial-session/13-dom/_samples/change-shopping-memo/script.js
This file contains hidden or 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 targetItem = document.getElementById("item2"); | ||
|
||
targetItem.textContent = "レモン"; |
11 changes: 11 additions & 0 deletions
11
docs/1-trial-session/13-dom/_samples/fruit-basket/index.html
This file contains hidden or 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> | ||
</head> | ||
<body> | ||
<ul id="fruit-basket"></ul> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains hidden or 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,8 @@ | ||
const basket = document.getElementById("fruit-basket"); | ||
const fruits = ["イチゴ", "スイカ", "バナナ"]; | ||
|
||
for (const fruit of fruits) { | ||
const item = document.createElement("li"); | ||
item.textContent = fruit; | ||
basket.appendChild(item); | ||
} |
This file contains hidden or 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
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.
五月雨式で申し訳ないのですが、この部分このセクションの冒頭にあった方が良くないですかね?
この部分は HTML なのですでに知っている情報なので、この HTML を最初に提示した上で、どうやって子要素を追加するのか、というストーリーになるのがいいんじゃないでしょうか。
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.
書き方が難しいですが頑張ってみます
Uh oh!
There was an error while loading. Please reload this page.
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.
ストーリーの目的は、div 要素の子要素に追加することではなく新しい要素を作ることなので、最初に空の div 箱を作っておくよりここで作るほうが自然な感じがしました。
なのでここのほうがいいと思います