JavaScript · DOM · Interactive
DOM Manipulation,
with live previews
querySelector, classList, events, createElement — every DOM method shown with a live mini-browser that updates as you step through each example.
// Select → Modify → React const btn = document.querySelector('#likeBtn'); btn.addEventListener('click', (e) => { e.target.classList.toggle('liked'); counter.textContent = ++count + ' likes'; }); // Build a notification dynamically const li = document.createElement('li'); li.textContent = 'New follower!'; list.appendChild(li);
What you'll learn
5 animated scenarios
Selecting elements
Find any element on the page
querySelectorquerySelectorAllgetElementByIdModifying elements
Change content, attributes, styles
textContentsetAttributestyleclassList
The cleanest way to manage styles
addremovetogglecontainsEvent listeners
Make pages interactive
addEventListenerevent objectdelegationCreating & removing
Build the DOM dynamically
createElementappendChildremoveQuick reference
All DOM methods
Selecting
Modifying
classList
Events
Creating / removing