dom
9 tutorials tagged “dom”.
- Changing Content and StylesChange text safely with textContent, why innerHTML with user input causes XSS, attributes vs properties, classList, inline styles, and data attributes.
- Creating and Removing ElementsBuild content with createElement, append, prepend, before, after, remove and replaceWith, use templates and fragments, and render lists from data.
- DOM AnimationsAnimate the page from JavaScript with CSS transitions and classes, requestAnimationFrame, and the Web Animations API, while respecting reduced motion settings.
- What Is the DOMThe Document Object Model: how the browser turns HTML into a tree of nodes, the document object, nodes vs elements, and why the DOM differs from HTML.
- DOM NavigationMove around the DOM tree: parents, children and siblings, element vs node properties, closest and matches, whitespace text nodes, and collections.
- Events and addEventListenerMake pages respond to people: event types, addEventListener, the event object, removing listeners, the once and signal options, and the older onclick way.
- Project: CounterBuild an accessible counter step by step: HTML first, state and a render function, limits, keyboard shortcuts, screen reader announcements and saving.
- Project: To-Do ListBuild a complete to-do list: add, complete, edit and delete tasks, filter them, keep counts, save to localStorage, and use one delegated listener.
- Selecting ElementsFind elements with querySelector and querySelectorAll, getElementById and friends, CSS selectors that work in JavaScript, and live vs static collections.