-
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
Conversation
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.
確認問題は本当に説明したことをそのまま写せばできるぐらいの難易度で、演習問題は理解していたら解けるぐらいの難易度にすると良いかと思います。
Deploying utcode-learn with Cloudflare Pages
|
下のような HTML が記述されています。 | ||
|
||
```html title="index.html" | ||
<div>Good <strong id="greeting-type">morning</strong>!</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.
これ 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.
そしたらとりあえずこのままにします。問題があれば後で両方変えましょう
<div id="greeting"></div> | ||
``` | ||
|
||
JavaScript を使って、太字で `Hello World!` と表示されるようにしてください。 |
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.
「太字で」だけだと style を書き換えるように聞こえるので、ヒントで説明を加えると良さそうです 👀
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.
まあ strong を使いましょうって普通に言っちゃいますか。
25993d9
to
5b75848
Compare
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.
LGTM
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.
他は良いと思います!
@@ -62,8 +119,8 @@ element.style.backgroundColor = "red"; | |||
中身のない空の要素が作成されるので、`textContent` を `おやつ` に設定してみましょう。 | |||
|
|||
```js title="script.js" | |||
const newItem = document.createElement("li"); | |||
newItem.textContent = "おやつ"; | |||
const snackItem = document.createElement("li"); |
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.
snackとitemは重複してる気がする?
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.
snackElementならHTML要素だという意味がelementに込められるからまだありだとは思うけど、snackItemだとitemとつけても情報量がそこまでは変わらない気がする。ある程度の効果はわからないでもないけど。
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.
良いと思います。
textContent
の操作、style
の操作、要素の作成と追加の 3 ステップにそれぞれ確認問題を追加しました。5d40b1cscript
要素はbody
要素の末尾に置かなければならない旨を明示しました。これらは「HTML」「JavaScript」の章でそれぞれ触れてはいるものの、それらの章の中ではほぼ問題にならないため、「DOM」で初めて問題に直面する人が多く戸惑いの原因になっているためです。element
からgreetingElement
に修正しました。bc2fad5