AI Frontend · Exercise 1 of 5Next
Intermediate
Show the Reply as Text
The button #show puts a model reply into #answer. The reply contains a tag with a harmless handler that adds 1 to window.bananas. Right now the page parses the reply as HTML and the handler runs.
Change the code so the reply is shown as text: #answer must contain the characters of the reply, and window.bananas must stay unset.
What Check tests
- Before the click
#answeris empty - After the click
#answercontains the tag as visible text - No element was created inside
#answer - The handler never ran
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.