The syntax of capturing events method for document object is

2014

The syntax of capturing events method for document object is

  1. A.

    CaptureEvents()

  2. B.

    CaptureEvents(Orgs eventType)

  3. C.

    CaptureEvents(eventType)

  4. D.

    CaptureEvents(eventVal)

Attempted by 155 students.

Show answer & explanation

Correct answer: C

Correct syntax: document.captureEvents(eventType)

  • Meaning of eventType: one or more Event constants such as Event.MOUSEDOWN or Event.MOUSEUP.

  • Example usage: document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)

  • Compatibility note: this method was used in older Netscape/legacy browsers and is deprecated in modern web development.

  • Modern alternative: use addEventListener with the capture option, for example:

    document.addEventListener('click', handler, true)

Explore the full course: Tpsc Assistant Technical Officer