html
├── head
│ └── title
└── body
├── h1
└── p// Find an element
const el = document.querySelector('.card');
// Change content
el.textContent = 'Hello';
// Add a class
el.classList.add('active');
// Event listener
el.addEventListener('click', () => console.log('clicked'));
// Create an element
const btn = document.createElement('button');
document.body.appendChild(btn);React and other frameworks build a Virtual DOM — a lightweight in-memory copy. On changes, they diff the old and new trees and update only the changed nodes. This is faster than direct DOM manipulation.