The Document Object Model (DOM) is a structured representation of an HTML document, enabling dynamic manipulation and interaction with elements using programming languages like JavaScript.
You can select an element from the DOM using methods like document.getElementById(), document.querySelector(), document.getElementsByClassName(), or document.getElementsByTagName().
Event delegation attaches a single event listener to a parent element, handling events from its child elements using event bubbling. It's useful for improved performance, fewer listeners, and managing dynamically added elements without needing to reassign event handlers.
A function is a reusable block of code that performs a specific task. It can take inputs (parameters) and return an output or result.
A common function is reusable code that performs a task, takes inputs (parameters), and returns output. Define it once and call it multiple times