Welcome to the Treehouse Community
Looking to learn something new?
what is the difference between .on(click) and .onclick() ?
what is the difference between .on(click) and .onclick() , and when should you use one vs another?
Steven Parker221,451 Points
I'm not familiar with ".onclick()". But if you're asking about the jQuery function
.click( handler ), it is (as described in the documentation) just a shorthand for:
.on( "click", handler ). There's no difference.
But there are other ways to use .on(), including the creation of delegated handlers.