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

Problem 3: Count the number of clicks

Each time the button #countBtn is pressed, increase the number shown in the heading #count by 1 and display it.

What you'll train

State the constraints

What you get

  • Specify the initial value
  • Show when the update occurs
  • Convey the display format

How to ask the AI

Specifically tell the AI that the count's initial value is 0, that it increases by 1 with each click, and how the increased number should be displayed in #count.

If you ask vaguelyIf you don't state the initial value, the AI might leave #count's initial display as an empty string, causing the number to jump unexpectedly on the first click.

あなたのコード

実行しました

プレビュー

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

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

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