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

Problem 4: Display typed text in real time

Each time text is typed into the input field #nameInput, rewrite the content of the paragraph #preview to "Hello, 〇〇" (where 〇〇 is the entered text).

What you'll train

Specify the output

What you get

  • Show the output text format
  • Convey how to embed the variable
  • Show the behavior for empty input

How to ask the AI

Convey the output text format "Hello, 〇〇" and that the 〇〇 part should be filled in directly with the input value. It also helps to specify what to display when the input field is empty.

If you ask vaguelyIf you don't specify what to display when the input field is empty, the AI might output "Hello, " as-is.

あなたのコード

実行しました

プレビュー

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

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

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