Challenge: Add and Remove DOM Elements
メニューを表示するにはスワイプしてください
Task
You're building a shopping cart where users can add and remove items.
- Add an Item to the Cart:
- Create a new
<li>element; - Create a new
<button>element; - Add new
<button>element to the new<li>element; - Add a new
<li>element to the<ul>with thecart-listID.
- Create a new
- Remove an Item from the Cart: Delete the specific
<li>element from the<ul>.
index.html
index.css
index.js
- Use
createElementto create a new<li>element; - Use
createElementto create a new<button>element; - Use
appendChildto add new<button>element to the<li>element; - Use
appendChildto add a new<li>element to the<ul>with the IDcart-list; - Use
removeChildto delete the specific<li>element from the<ul>.
index.html
index.css
index.js
すべて明確でしたか?
フィードバックありがとうございます!
セクション 2. 章 11
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 2. 章 11