Results for “Event control”
Small, practical examples. Search by task or narrow things down below.
Give an LED pin a constant name
Arduino / C: Use const to name the built-in LED pin and reuse it in output instructions.
Arduino / C✓ Tested
Handle a button click
Attach a jQuery click handler to update text.
jQuery✓ Tested
Handle a form locally
Prevent default form navigation while displaying input with jQuery.
jQuery✓ Tested
Handle a terminating error
Catch conversion failures and produce a clear fallback.
try catch✓ Tested
Handle dynamically added buttons
Delegate a jQuery event from a stable parent to later children.
jQuery✓ Tested
Include a nonvisible value in form data
HTML: A named hidden input contributes data without adding a visible editing control.
HTML✓ Tested
Increment a shared counter safely
C++: Atomic increments prevent lost updates when two threads change the same counter.
C++✓ Tested
Join array items with a one-character separator
Bash Scripts: A local IFS controls the separator used by the quoted star expansion.
Bash Scripts✓ Tested
Keep a function variable local
Bash Scripts: Local prevents an ordinary function assignment from replacing a caller variable.
Bash Scripts✓ Tested
Keep an action button from submitting a form
HTML: Specify type button for controls whose purpose is a local action.
HTML✓ Tested
Measure a short delay with micros
Measure elapsed microseconds around a short operation.
micros✓ Tested
Mirror input text
Update a result as the user types using a jQuery input event.
jQuery✓ Tested