StaffCoder
TypeScript
Vanilla TypeScriptTypeScript 7.0
6 modules · 24 challengesSign up
Modules6 modules · 24 challenges
Master event handling to connect user actions with meaningful changes in your application.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Quantity Stepper

Sign up to unlock
0%0 of 1 solvedeasy
About this challenge

Wire increment / decrement buttons to a numeric display bound between 1 and a supplied maximum, disabling each button at its bound. Values typed directly into the field are clamped on blur, and a change callback fires only when the value actually changes — not on repeat writes of the same number.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Dismissible Dialog

Sign up to unlock
0%0 of 1 solvedeasy
About this challenge

Open and close a dialog element, closing on the close button, on Escape, and on a click of the backdrop but not the panel. Focus moves into the dialog on open and returns to the element that opened it on close, and the key listener is removed on close so a later Escape press does nothing.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Live Character Counter

Sign up to unlock
0%0 of 1 solvedeasy
About this challenge

Update a counter on every input event showing characters used against a maximum, add a warning class within the last 20 chars, and block further input beyond the limit while still allowing deletion. Pasting an over-length string truncates to the limit. Use the input event, not keydown.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Filter Toolbar

STAR
Solving it completes the module
0%0 of 1 solvedeasy
About this challenge

Wire a text input, a category select, and an in-stock checkbox so that changing any of them filters an in-memory array and re-renders the list under AND semantics — two active filters compose, not replace each other. Show a result count and a no-matches message; clearing a filter restores the previous set; the original array is never mutated.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.