The Document Object Model (DOM) is a model that represents the structure and content of web document as a collections of objects.
To select elements in the DOM, we use getElementById()where we need to get unique id, another one is getElementsByClassName() to select a specific class name or another is querySelector() to select an element using a CSS Selector that can combine ID,Class,tag name and attributes
Event delegation is a mechanism where we attach a single event listener to a parent element allowing it to handle events triggered on any child elements. We delegate the event handling to the parent element instead of attaching the listener to each individual child.Its useful because it improves performance by reducing event listeners and simplifying code for large and dynamic lists.
we manipulate the attribute an element and style using the DOM we use getAttribute() to get the value of specific attributed. Then we use setAttribute() to set the value of specific attributed and then we remove the specific Attribute using removeAttribute() . Then where needed to the style we access the defines inline css selector or method.