Web Basics
Tip Calculator
Your first interactive page: type a bill, see the tip update live.
The gentlest possible start. Three inputs, a little math, and the numbers on screen change as you type. You'll learn the pattern behind almost every web page: read the inputs, calculate, write the answer back.
What's inside
- Live updates on every keystroke and slider move
- The read → calculate → render loop, explained line by line
- Currency formatting with the built-in Intl API
- Automatic light & dark mode via one CSS block
- No build step — double-click index.html and it works
Quickstart
$ curl -LO https://devai.io/downloads/tip-calculator.zip$ unzip tip-calculator.zip && cd tip-calculator$ open index.html # or just double-click the file
about this tutorial
A devai.io starter tutorial — small, complete, and readable in one sitting. Master this loop and most of the web makes sense.
More in Web Basics
view allWeb Basics
To-Do List
Keep a list, tick things off, and have it still be there after a refresh.
HTMLCSSJavaScriptlocalStorage
View template zip + preview
Web Basics
Countdown Timer
Count down to any moment — days, hours, minutes, seconds, ticking live.
HTMLCSSJavaScriptDates
View template zip + preview
Web Basics
Dark Mode Toggle
A theme switch that remembers your choice — the feature every site wants.
HTMLCSSJavaScriptlocalStorage
View template zip + preview