CodeDrill
day_streak: --
← 問題一覧に戻る
JavaScript ・ Forms

Problem 69: Reflect the Selected Color on a Square

When a color is selected from the select box #colorSelect, make it so that the background color of the square #colorBox becomes the selected color. Use the change event.

What you'll train

Specify the input

What you get

  • Specify the event type
  • State how the value is reflected
  • Clarify the target element

How to ask the AI

Clearly tell the AI that when the value of the select box #colorSelect changes, the background color of #colorBox should be set to that value, using the change event. It also helps to mention that the option's value can be used directly as the color name.

If you ask vaguelyThe AI tends to use the input event instead, resulting in an implementation that runs before the selection is finalized.

あなたのコード

実行しました

プレビュー

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

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

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