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

Problem 64: Hide an Element with a Button

Make it so that clicking the button #hideBtn makes the message #box hidden (display: none).

What you'll train

Specify the output

What you get

  • Specify the element ID precisely
  • State the visual change clearly
  • Specify the event type

How to ask the AI

Clearly tell the AI that clicking the button #hideBtn should hide the element #box using display:none. It also helps to clearly state the scope of the behavior, such as whether it should reappear if the button is clicked again.

If you ask vaguelyThe AI may use visibility:hidden instead, or implement toggle behavior that shows and hides the element alternately on each click.

あなたのコード

実行しました

プレビュー

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

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

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