RawSushi's Tech Journal
My online tech scrapbook where I keep my notes in case I need to look them up later
Friday, June 1, 2012
Javascript "this" Keyword
The "this" keyword in JavaScript is contextual and refers to the element that it was called from.
If the context is a page, then it refers to the page. If the context is withing the "onclick" of an HTML element, then it refers to the HTML element.
Reference:
http://www.quirksmode.org/js/this.html
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment