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 trial

JavaScript jQuery Basics (2014) Introduction to jQuery Ways to Include jQuery in a Project

Miguel Nunez
Miguel Nunez
3,266 Points

In jQuery is there such thing as a function name natively with out JS engagement?

I know jQuery is a libary of JavaScript but I was just curious so lets just say I have a lot of functions in jQuery I was wondering is there a way I can distinguish them by names? Or is the power of distinguishment based on the jQuery functions reference contents for example like an Id or a class id or a tag name reference.

To better understand me then here's my question on another website. https://stackoverflow.com/questions/45653250/in-jquery-is-there-such-thing-as-a-function-name-natively-with-out-js-engagement

1 Answer

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,075 Points

I don't thing that JS Engagement is an actual term....so I wouldn't call what you are trying to do that, I think it will confuse people because they won't be to sure what JS Engagement actually is.

To answer your question...yeah I think so if I understood everything correctly.


You can still call functions in JQuery don't forget it is just a javascript library what JavaScript does, it can do as well (don't quote me on that though I haven't used JQuery since I was in middle school (in senior year of college now..lol))

function sayHello() { alert('Hello!');}

$("#hello-button").click(sayHello);

That is how you would pass named functions in JQuery.