Lesson 5 — Create an Interactive Story
Build a tiny story where the reader makes two choices and reaches two possible endings. Output: my-first-interactive-story.html — a free, parent-guided lesson.
- ✓One fictional character
- ✓One opening scene
- ✓Two choices
- ✓Two endings
- ✓A restart button
- ✓Saved as my-first-interactive-story.html and opened locally in the browser
The key rules
- Character:
- Place:
- Problem:
- Choice A:
- Choice B:
- Ending A:
- Ending B:
Lesson path
- •A robot choosing between two doors
- •A dragon choosing a snack
- •A space explorer choosing a planet
- •A cat choosing where to nap
- •A tiny wizard choosing a spell
- •A submarine choosing a path
- •A garden helper choosing which seed to plant
Prompt cards
Copy-friendly prompts for a parent-approved AI assistant. When copying prompts, use ideas, not secrets.
Help me create a tiny fictional interactive story for a child beginner. It should have one character, one opening scene, two choices, two endings, and a restart button. Do not ask for personal information.
Create a one-file HTML interactive story. It should work when saved as my-first-interactive-story.html and opened in a browser. Use simple HTML, CSS, and JavaScript in one file. Do not use external libraries, accounts, uploads, or online features.
Make the two choices clearer and easier for a child to understand. Keep the story tiny. Keep two choices, two endings, and a restart button.
My interactive story did not work. Please help me check the code. Explain the fix simply. Keep it as one HTML file.
- Open a plain text or code editor.
- Paste the full code.
- Save the file as
my-first-interactive-story.html. - Make sure the filename ends in
.html(not.txt). - Open the file in Chrome, Safari, or Edge.
- If it opens as plain text, check the filename and re-save.
- If buttons do nothing, ask the AI to fix the JavaScript while keeping one file.
- ✓The page opens
- ✓The opening scene appears
- ✓Choice A works
- ✓Choice B works
- ✓Ending A appears
- ✓Ending B appears
- ✓Restart button works
- ✓Story stays fictional
- ✓No private information is included
- ✓No upload/account/online feature was added
- File opens as text, not a storyThe filename must end in .html (not .txt). Re-save with the correct ending.
- Blank screenOpen the file again, or ask the AI: “My story shows a blank screen. Fix it and keep it as one HTML file.”
- Buttons do nothingAsk the AI to fix the JavaScript for the choice buttons, keeping everything in one file.
- Both choices lead to the same endingAsk the AI to make Choice A and Choice B lead to two different endings.
- Restart button does not workAsk the AI to make the restart button return to the opening scene.
- Story became too longAsk for a shorter version: one scene, two choices, two short endings.
- AI added too many choicesAsk the AI to keep only two choices and two endings.
- AI split the project into several filesAsk the AI to put all the HTML, CSS, and JavaScript back into one single HTML file.
- AI asked for private detailsDo not share them. Say: “Use made-up, fictional ideas only. Do not ask for personal information.”
You planned a tiny fictional story, gave the reader two choices and two endings, and added a restart — all in one local HTML file.
Next: Lesson 6 — Build a Useful Mini Tool →