Jump to content

Reference that associates event object with getAttribute Solved with thanks in our final postmy


niche

Recommended Posts

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?

Edited by niche
Link to comment
Share on other sites

I reviewed the html dom tutorials, but couldn't find an explicit statement that made the connection between event.currentTarget and getAttribute although http://www.w3schools...odes_access.asp came close. http://www.w3schools.com/jsref/dom_obj_element.asp comes close too because an element is a node. Did you have another reference in mind?

Edited by niche
Link to comment
Share on other sites

I'm not really sure what to say, this page: http://www.w3schools.com/jsref/event_currenttarget.asp says that it points to an element ("returns" isn't technically correct, it's a property not a function). Once you know it points to an element then you can look at the reference for elements to see what's available for it. A DOM node is basically the same thing as an element, but since we're working with Javascript we're working with the DOM. I think of an element as the rendered representation on a page, in Javascript it's a DOM node and in HTML it's a tag. They all represent the same thing.

Link to comment
Share on other sites

Thanks jsg. I was was confused about the difference between a node and an element. They're not mutually exclusive. An element is a type of node. Thanks again. Niche Edit: This topic was a big help in being able to better use the documentation.

Edited by niche
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...