Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMiles Falk
6,566 PointsThis vs event.target
What is the significance in using 'This' instead of 'event.target' when obtaining a reference to the current element?
Thanks :)
1 Answer
john larson
16,594 PointsSomeone else I'm sure will give a more concise answer, but here is my stab at it. This: calls a jquery object with whatever is available to it as that jquery object. Event.target just references the element. Therefore none of the jquery attributes are associated with it.
Miles Falk
6,566 PointsMiles Falk
6,566 PointsGotcha. Thanks for the clear explanation!