AI Frontend · Exercise 1 of 5Next
Beginner
A Starter That Sends Once
The page shows two starter buttons inside #starters. Each button carries its question in data-prompt. When a starter is clicked, send that question to /api/ask with POST and a JSON body { "question": … }, read the streamed reply and add each piece to #answer.
Then hide the whole #starters list (set its hidden property to true). Two clicks in the same instant must reach the server only once.
What Check tests
- Before any click,
#answeris empty and#startersis visible - Two quick clicks on a starter send the question to the server exactly once
#answershows the whole reply#startersis hidden after a starter was used- The other starter does not send a second question
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.