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 trialDongyun Cho
2,256 Points.on() and why JS cannot call future stuffs?
I'm struggling with on()'s use and meaning. One thing that I cannot understand is, I've learned that in Javascript, future stuffs like named function can be implemented in a past function. And that flexibility is a great thing in Javascript differentiated from other languages. I don't remember how exactly call that feature. But why click() or other events that used as a with on() doesn't be applied to this feature ? why do we have to use .on() eventhough there is these feature in JS??
1 Answer
Lipak Sahu
2,229 PointsHi, as per my knowledge by using on(), we can add multiple events for a single element. In fact we can turn off the event handler by using off().