-
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 の課題の追加 #519
DOM の課題の追加 #519
Conversation
と appendChild、createElementの追加 |
Deploying with
|
Latest commit: |
d4a18e7
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b6d0792f.utcode-learn.pages.dev |
Branch Preview URL: | https://improve-dom-exercise.utcode-learn.pages.dev |
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.
普通にレビューしてみたのですがそもそもクラスもやっていない状況でここまでやる意味ありますかね?
クラスの課題を別のものにすることになって、クラス以外にToDoまでにDOMのメソッドの説明を入れるところがここくらいしかなかったです |
DOMは非常に脱落者が多いところなのでこれ以上難しくしたくはないですね。とりあえず、おみくじまでは全員が到達して欲しいので。後は、クラスをやる前に説明すると後方参照が増えるのでなるべく避けたいという気持ちもあります。クラスのところも量を増やしたくはないけど、DOMよりはマシかなという感じだと思います。 |
クラスの後に「DOM の提供するメソッド」みたいなセクションを作りますか? |
メモ: 10/30 のミーティングで Node#appendChild と document.createElement は DOM 側に統合することになった |
docs/1-trial-session/13-dom/index.md
Outdated
const newElement = document.createElement("div"); | ||
newElement.textContent = "Hello World!"; | ||
parent.appendChild(newElement); |
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.
newElement はさっき出てきたのでここで書く必要はないのでは?
span 初出だと思うので、button のほうが良ければ revert してください。
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.
よさげですね!!!
そして、`要素1.appendChild(要素2)` とすることで、要素1の子要素に要素2を追加し、画面に表示することができます。 | ||
今回は、`div` 要素の子要素にしてみましょう。 | ||
|
||
```html title="index.html" | ||
<div id="parent-element"></div> | ||
``` |
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.
書き方が難しいですが頑張ってみます
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 箱を作っておくよりここで作るほうが自然な感じがしました。
なのでここのほうがいいと思います
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.
僕は良いと思います!!!!!!!
良さげならマージします! |
No description provided.