
Fujitsu Siemens Computers white keyboard by Mille.oiram, licensed under CC0 1.0. Unmodified. Illustrative stock photograph. Not a picture of the coding assistant or the finished page.
Analysis
NextChirp
Build Your First Small Web Page With an AI Coding Assistant
Published
A one-page tip splitter that runs in your own browser makes a manageable first interactive app: small, and checkable by hand. Here's how to plan it, prompt an AI assistant for it, and test it yourself.
By NextChirp
For a first interactive app, build something tiny that you open on your own computer and that needs no personal data: for example, a single page that splits a restaurant bill and tip between friends. An AI coding assistant can draft it; your job is to read it, understand it and test it before relying on it. This is a source-based guide. The prompts and test values are illustrative: we calculated the expected numbers by hand, but we haven't run any code, and none is supplied here.
Why a small single-file app
Mozilla's MDN “Your first website” series covers planning a site, writing its HTML, CSS and JavaScript, and publishing it, and assumes a code editor and web browsers installed. A file with those three parts opens in your browser and can respond to what you type, which makes it a small interactive app.
Opening a file locally doesn't by itself keep it private: code an assistant writes can still load outside scripts, fonts or trackers, or send data elsewhere. That's why the review step below matters.
Plan before you prompt (our suggestions)
- What it does: enter a bill amount, a tip percentage and the number of people; show each person's share.
- The rules: the bill must be more than zero; the tip can be zero or more; people must be a whole number of at least 1.
- The formula: share = bill × (1 + tip ÷ 100) ÷ people, rounded to two decimal places.
- What it doesn't do: no saving, no sign-in, no outside links or requests.
MDN's series similarly starts with planning what the site will show before writing code.
Prompt the assistant (illustrative, not run)
GitHub's best practices for Copilot advise breaking down complex tasks, being specific about requirements and providing examples of inputs and outputs. Those tips apply to other coding assistants too. An illustrative first prompt:
"Create a single HTML file with inline CSS and JavaScript for a bill splitter. Inputs: bill amount (must be greater than zero), tip percentage (zero or more), number of people (a whole number, 1 or more). Show each person's share rounded to two decimal places. Show a clear message for blank or invalid inputs. No external scripts, fonts, images, links, imports or network requests, and no storage. Add comments explaining each part for a beginner."
Then ask follow-ups one at a time: "Explain what this function does line by line," "Add a reset button."
Review before you open it
GitHub says Copilot "is still a tool capable of making mistakes" and that you should validate its suggestions. Its tips: understand suggested code before using it (you can ask the assistant to explain it), review suggestions for functionality and security as well as readability, and use automated tests and tooling.
Before opening the file, read it and search it for "http", "src=", "import" and "fetch". For this app there should be none. If you can't follow the code, ask someone qualified to look at it first. Reviewing lowers risk; it doesn't guarantee the code is harmless.
Save and open it (beginner steps)
- Open a plain-text code editor, not a word processor.
- Paste only the code you've reviewed.
- Save it as `index.html` (check it hasn't become `index.html.txt`).
- Open the file in your browser.
Don't run terminal commands or install anything a chat suggests for this project; it shouldn't need either.
Test it (illustrative values, calculated by hand)
| Bill | Tip % | People | Expected result |
|---|---|---|---|
| 100 | 20 | 4 | 30.00 each |
| 50 | 0 | 2 | 25.00 each |
| 100 | 15 | 3 | 38.33 each (115 ÷ 3 = 38.333…) |
| 80 | 15 | 0 | Error message |
| 80 | 15 | -2 | Error message |
| 80 | 15 | 2.5 | Error message |
| blank | 15 | 2 | Error message |
Work out each expected value yourself, then compare. Note the third row: three shares of 38.33 add up to 114.99, a cent short, because of rounding. Don't use the app for real payments until you've checked how it handles that.
Passing these rows would check only these cases, not establish that the app is correct or safe in general.
Keep it low-risk
- No secrets in code or prompts: no passwords, API keys or personal data in the assistant or the file.
- Keep it on your computer. Putting it online is a separate step with its own considerations; MDN's series covers publishing when you're ready.
- Check your tool's terms and plan. Assistant features and limits vary by product and plan.
Next steps
Once it works, change one thing yourself without the assistant, such as a colour or a label, to check you understand the structure.
Sources
Sources checked November 8, 2026. GitHub's page describes GitHub's own product.
Disclosure: NextChirp has no sponsorship, affiliate arrangement or free products from GitHub, Mozilla or any AI or software company for this article.