Important FAQ

What is Document Object Model (DOM) ?

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.

How do you select an element from DOM ?

You can select an element from the DOM using methods like document.getElementById(), document.querySelector(), document.getElementsByClassName(), or document.getElementsByTagName().

What an event delegation in the context of the DOM, and why is it useful ?

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.

How to function work ?

A function is a reusable block of code that performs a specific task. It can take inputs (parameters) and return an output or result.

How to make a common function ?

A common function is reusable code that performs a task, takes inputs (parameters), and returns output. Define it once and call it multiple times