JavaScript Mini Projects
Build JavaScript Mini Projects with simple code, clear steps, and visible results. Practise forms, games, timers, lists, and small apps with common mistakes explained.
20 programs · open one, then the next
Start with Todo List- 01Todo ListBeginnerManage tasks in JavaScript with an array, stable IDs, and a render function. Checkboxes complete tasks and buttons remove them; refreshing clears the list.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 02CalculatorBeginnerBuild a calculator in JavaScript using valueAsNumber and a fixed set of operation functions, not eval. Reject non-finite inputs and division by zero.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 03Stopwatch with Start, Stop and ResetBeginnerBuild a browser UI stopwatch in JavaScript with Start, Stop and Reset buttons and performance.now. Save elapsed time on stop; repeated Start clicks are ignored.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 04Countdown Timer with a Start ButtonIntermediateMake a browser UI countdown in JavaScript with a start button and a three-second deadline demo. Subtract Date.now on each redraw; restarting clears the old timer.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 05Quiz AppIntermediateScore a two-question quiz in JavaScript using an array and radio-button forms. Convert choice indexes to numbers; answers are visible in the page code.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 06Weather AppIntermediateDisplay sample weather in JavaScript with an async function and field checks. The default uses local Pune data, not live forecasts or a working API endpoint.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 07Image CarouselBeginnerBrowse three generated image cards in JavaScript with Previous and Next buttons. Use % to wrap indexes; each change updates the caption and alt text.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 08Modal/LightboxBeginnerOpen lab rules in JavaScript with dialog.showModal and close. Check backdrop clicks against the dialog bounds; restore focus to the opening button on close.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 09Tabs/AccordionBeginnerSwitch course sections in JavaScript with hidden and aria-pressed, plus native details for FAQs. Toggle buttons are not a complete arrow-key tab widget.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 10Autocomplete SearchIntermediateSuggest subjects in JavaScript with lowercase matching, filter, and slice as input changes. Show up to five buttons; this is not a full combobox widget.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 11Shopping CartIntermediateTrack a cart in JavaScript with a Map keyed by product ID and integer paise prices. Combine quantities and reduce totals; this console demo has no checkout.Open example →jsconst cart = new Map(); function add(product, quantity = 1) { if (!Number.isInteger(quantity) || quantity < 1) throw new Error('Quantity must be a positive integer'); if (!Number.isInteger(product.pricePaise) || product.pricePaise < 0) throw new Error('Price must be non-negative integer paise');
- 12Tic-Tac-ToeIntermediateBuild Tic-Tac-Toe in JavaScript with nine cells and eight winning lines checked by some and every. Stop after a win or draw; two players share one browser.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 13Snake GameAdvancedMove a snake in JavaScript on a canvas grid using timed ticks and queued arrow keys. Place food in free cells; wall or body collisions end the game.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 14Memory GameIntermediateMatch shuffled cards in JavaScript with arrays and a Set. Lock input during the mismatch delay; a round counter stops old timers from changing a new game.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 15Drag and Drop ListIntermediateReorder subjects in JavaScript with drag events and array.splice. Move up buttons use the same logic; external dropped text is ignored and refresh resets order.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 16Form BuilderAdvancedCreate labelled fields in JavaScript with DOM methods, then preview FormData as JSON. Unique names keep fields separate; even number inputs return strings.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 17Chat ApplicationAdvancedRender a local chat in JavaScript with form events, textContent, and a delayed demo reply. Messages stay in this tab; no network or second person is involved.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 18Data Table with Sort/FilterIntermediateFilter a marks table in JavaScript with includes and sort by numeric subtraction. Render new rows from a filtered array without reordering the source list.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 19Progress BarBeginnerUpdate a five-chapter tracker in JavaScript with a native progress element and a percentage. Clamp the count at five; clicks are not proof of reading.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>
- 20Infinite ScrollIntermediateLoad notice batches in JavaScript with IntersectionObserver and a Load more button. A loading flag prevents overlap; three local pages end the sample list.Open example →js<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>JavaScript practice</title>