SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: events and getAttribute

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    events and getAttribute

    I know event.currentTarget works with getAttribute, but I can't find a reference that says that. Is there one? If not why? I so, where should I look?

  2. #2
    Hosting Advisor silver trophybronze trophy
    SitePoint Award Recipient cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    2,809
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    The reason event.currentTarget works with getAttribute is because currentTarget is a DOM element and DOM element have access to getAttribute.

    Sources:
    http://www.w3schools.com/jsref/event_currenttarget.asp - States that currentTarget is the DOM element that triggered the event
    http://www.w3schools.com/jsref/met_e...tattribute.asp - States getAttribute can be used on DOM elements

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very clear explanation. Thanks cpradio.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •