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

Problem 1: Change a heading's color with a button

The HTML below has a heading #title and a button #colorBtn.

Write JavaScript so that clicking the button changes the heading's text color to #f2a950.

What you'll train

Specify the output

What you get

  • Specify the element ID
  • State the color code explicitly
  • Convey the event name

How to ask the AI

By telling the AI something like "Change the text color of #title to #f2a950", including the target element ID, the property to change, and the specific value after the change (the color code) together, it becomes easier for the AI to implement the heading change exactly as intended.

If you ask vaguelyIf you don't specify the color code, the AI may pick an arbitrary color (like red or blue) instead of the intended #f2a950.

あなたのコード

実行しました

プレビュー

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

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

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