CodeDrill
day_streak: --
← 問題一覧に戻る
JavaScript ・ Arrays/DOM Generation

Problem 6: Add items to a list

When text is entered into the input field #itemInput and the button #addBtn is pressed, add that text as a new <li> to #itemList. Clear the input field after adding.

What you'll train

Cover the edge cases

What you get

  • Show the behavior for empty input
  • Convey the steps for element creation
  • Specify the state after processing

How to ask the AI

Specifically instruct the AI on whether to add to the list when the button is pressed with an empty input field, and that the input field should be cleared after adding.

If you ask vaguelyIf you don't convey the behavior for empty input, the AI might add an empty <li> to #itemList as-is.

あなたのコード

実行しました

プレビュー

AIレビュー(プロンプト練習)

コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。

先にコードを実行し、テストを1つ以上通してください。