W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2005

Query regarding canTrigger() method of EventTarget Interface

From: Sarika Garg <sagarg@quark.com>
Date: Mon, 11 Apr 2005 20:11:42 +0530
Message-ID: <2BC68159E3EC814BA1E81C108DF99A4203545CD1@EXCH-IND-VS1.india.quark.com>
To: <www-dom@w3.org>

I have a query on the canTrigger() method introduced in DOM Events level
3 Specification. The specification says that:


This method allows the DOM application to know if an event listener,
attached to this

EventTarget or one of its ancestors, will be triggered by the specified
event type during

the dispatch of the event to this event target or one of its


type of type DOMString

The event type for which the EventListener is registered.

Return Value

boolean true if an event listener will be triggered on the event target
with the

specified event type, false otherwise.


Does it mean that we need to check if there are any event listeners of
the event type passed as parameter registered on the eventTarget or its

If there are any listeners of the particular event type registered,
canTrigger() will return true else false. I mean what is the basis of
determining that an event will be triggered? Secondly, are we talking
about the capture phase when we say dispatch of the event to the event
target or one of its descendants.




Received on Tuesday, 12 April 2005 04:59:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:12 UTC