Skip to content

Commit

Permalink
「要素を追加」の確認問題を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
naka-12 committed May 13, 2024
1 parent f595c39 commit 25993d9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 42 deletions.
11 changes: 0 additions & 11 deletions docs/1-trial-session/13-dom/_samples/hello-world-bold/index.html

This file was deleted.

This file was deleted.

Binary file removed docs/1-trial-session/13-dom/hello-world-bold.png
Binary file not shown.
26 changes: 0 additions & 26 deletions docs/1-trial-session/13-dom/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,6 @@ packingList.appendChild(newItem);

これで、既存の `ul` 要素の子要素に新しい `li` 要素が追加され、「おやつ」が加わった持ち物リストが表示されます。

### 確認問題

下のような HTML ファイルがあります。

```html title="index.html"
<div id="greeting"></div>
```

JavaScript を使って、太字で `Hello World!` と表示されるようにしてください。

![太字で表示された Hello World!](./hello-world-bold.png)

<Answer>

```js title="script.js"
const strongElement = document.createElement("strong");
strongElement.textContent = "Hello World!";

const greetingElement = document.getElementById("greeting");
greetingElement.appendChild(strongElement);
```

<ViewSource url={import.meta.url} path="_samples/hello-world-bold" />

</Answer>

## 初級演習

### 買い物リストの書き換え
Expand Down

0 comments on commit 25993d9

Please sign in to comment.