javascript Node addEventListener( )

addEventListener( ) NN 6 IE n/a DOM 2  

addEventListener("eventType", listenerFunction, useCapture)

  

Binds an event handler function to the current node so that the function executes when an event of a particular type arrives at the node either as event target or during event propagation. Note that W3C DOM events propagate through text nodes, as well as element nodes. The node listens for the event type either during event capture or event bubbling propagation, depending upon the setting of the Boolean third parameter. You may invoke this method multiple times for the same node but with different parameter values to assign as many event handling behaviors as you like, but only one listener function may be invoked for the same event and propagation type. If the event listener is added on a temporary basis, it may be removed via the removeEventListener( ) method.

 
Parameters
 
  • 1st parameter: A string of one event type (without the "on" prefix) known to the browser's object model. The W3C DOM knows the following event types (and Netscape 6 implements most of them):
  • "click","mouseover" ... view all on**** events

  • 2nd parameter:  A reference to the function to execute when the node hears the event type in the specified propagation mode. As this is a reference to a function object, do not surround the name in quotes, nor include the parentheses of the function. At execution time, the browser automatically passes the current event object as a parameter to the listener function.
  • 3rd parameter: A Boolean value. If true, the node listens for the event type only while the event propagates toward the target node (in event capture node). If false, the node listens only when the event bubbles outward from the event target. If the current node is the target of the event, either Boolean value may be used.
 
Returned Value

None.


  • Erica
    #1
    2009-11-18
    [Quote]
    It looks like there is supposed to be list of supported event types following the colon at the end of the description of the first parameter. Could someone add that list in?

    Thanks.
  • javascript manual
    #2
    2009-11-18
    [Quote]
    http://javascript.gakaa.com/c/events.aspx
    on*** event
    Here it is.
  • #3
    2010-04-06
    [Quote]
    It looks like there is supposed to be list of supported event types following the colon at the end of the description of the first parameter. Could someone add that list in?
  • javascript manual
    #4
    2010-04-06
    [Quote]
    [medyum: It looks like there is supposed to be list of supported event types following the colon at ...]
    without on like "click","mouseover"

    We highlighted it.
  • #5
    2010-08-06
    [Quote]
    thank you admin good post topic.
  • #6
    2011-05-10
    [Quote]
    It looks like there is supposed to be list of supported event types following the colon at the end of the description of the first parameter.
Erica
javascript manual
medyum
dizi izle
Hava durumu

1319,Nickname,Homepage or email,Comments here,Add comment