Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What are the two phases of event propagation in the DOM?

View

In which phase does the event go from the document to the target element?

View

What happens when you call event.stopPropagation()?

View

When an event reaches the target element, what phase does it enter?

View

What will happen if you do not stop an event from propagating in the bubbling phase?

View

How do you add an event listener that captures events during the capturing phase?

View

Which of the following is true about event delegation?

View

If you have multiple nested elements with event listeners, which event will fire first?

View

What is the default behavior of events in the bubbling phase?

View

Which method can be used to prevent the default behavior of an event?

View

What are the two phases of event propagation in the DOM?

Capture and Bubbling
Start and End
Parent and Child
None of the above

In which phase does the event go from the document to the target element?

Bubbling
Capturing
Stopping
Propagating

What happens when you call event.stopPropagation()?

It stops the event from reaching the document
It stops the event from reaching the target element
It prevents the event from being triggered
It allows the event to continue bubbling

When an event reaches the target element, what phase does it enter?

Bubbling
Capturing
Target phase
None of the above

What will happen if you do not stop an event from propagating in the bubbling phase?

The event will stop
The event will not trigger any further listeners
The event will continue to trigger other listeners on parent elements
The event will be ignored

How do you add an event listener that captures events during the capturing phase?

element.addEventListener('event', handler, false);
element.addEventListener('event', handler, true);
element.on('event', handler);
element.addCaptureListener('event', handler);

Which of the following is true about event delegation?

It requires multiple event listeners
It allows you to attach a single event listener to a parent element
It does not work for dynamically added elements
It can only be used for click events

If you have multiple nested elements with event listeners, which event will fire first?

The innermost listener
The outermost listener
They will fire simultaneously
None, it will be ignored

What is the default behavior of events in the bubbling phase?

Events bubble up through the DOM tree
Events only trigger on the target element
Events cannot be captured
Events stop propagating automatically

Which method can be used to prevent the default behavior of an event?

event.stopPropagation()
event.preventDefault()
event.stopImmediatePropagation()
event.cancelDefault()