Each time the button #toggleBtn is pressed, add or remove (toggle) the active class on the paragraph #panel. While the active class is applied, the text turns orange.
What you'll train
State the constraints
What you get
How to ask the AI
Clearly tell the AI that each press of the button #toggleBtn should "toggle" the active class on the paragraph #panel—adding it if absent, removing it if present. It also helps to specify explicitly that behavior like classList.toggle is needed.
If you ask vaguelyThe AI sometimes only adds the class and forgets to write the logic for removing it on a subsequent press.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。