JavaScript Interactivity
Pure Vanilla JavaScript — No Frameworks, No Libraries
10 Interactive DemosInteractive Demos
Each demo demonstrates a specific JavaScript concept. All built with event delegation, DOM manipulation, and browser APIs.
Custom Dropdown
Closes when clicking outside via document-level event delegation. Keyboard accessible.
Modal Dialog
Blurred backdrop, smooth scale animation, closes via button, backdrop click, or Escape key.
Real-Time Validation
Validates on blur, clears on valid input. Error messages injected directly into the DOM.
Animated Tabs
Sliding underline indicator with smooth content crossfade between panels.
This tab component demonstrates active state management and content switching using pure JavaScript. No hidden iframes or display-toggle tricks.
Animated underline indicator slides between tabs. Content fades in with a subtle translateY animation. Fully keyboard navigable.
Built with: event listeners on buttons, classList toggling, and CSS transition properties. Zero external dependencies.
Accordion / FAQ
Smooth expand/collapse via max-height. Only one panel open at a time. Chevron rotation on toggle.
Theme Toggle
Toggle persists preference in localStorage. Demonstrates client-side state persistence across sessions.
Toast Notifications
Stacking toasts that slide in from the right and auto-dismiss after 3 seconds. Four severity types.
Scroll Progress Bar
The gradient bar at the very top of the page fills as you scroll. Tracks scroll position relative to total document height.
Look at the top of the page as you scroll.
Drag and Drop Sortable
Reorder items by dragging. Uses dragover with position calculation to determine insertion point.
- Learn JavaScript fundamentals
- Master DOM manipulation
- Understand event delegation
- Build real projects
- Deploy to production
Infinite Scroll
Loads more items as you scroll to the bottom of the container. Simulates paginated API loading.