What is the purpose of the capture parameter in addEventListener method?

  • To specify the event phase
  • To control event order
  • To attach multiple listeners simultaneously
  • To prevent event propagation during capture phase
The capture parameter in the addEventListener method is used to specify the event phase during which the listener should be triggered. When set to true, the listener is triggered during the capturing phase, and when set to false, it is triggered during the bubbling phase. This parameter helps control the order of event execution.
Add your answer
Loading...