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 trialPatrick Eaton
3,860 PointsWhat does $() signify?
I believe this is the first time in this course that I've seen the $(this.htmlToken)
notation. What does the $()
signify here?
2 Answers
Patrick Eaton
3,860 PointsI see. Thank you, Bert Witzel! Not only did you answer my question, but you also clued me in to the fact that jQuery is not so much of a thing anymore. I was thinking I would need to learn that next, but perhaps I would be better off learning more about the latest JavaScript advancements!
Courtney Wilson
8,031 PointsJust an FYI, it may not be common to use in newer projects but some places still use it due to outdated code/codebase and not willing or able to update. I had to learn it on the fly because it was used heavily in one of my projects at work.
Patrick Eaton
3,860 PointsThank you, Courtney.
Now that I know this comes from jQuery, I looked up the relevant documentation:
...
jQuery()
— which can also be written as$()
— searches through the DOM for any elements that match the provided selector and creates a new jQuery object that references these elements...
Bert Witzel
Full Stack JavaScript Techdegree Graduate 27,918 PointsBert Witzel
Full Stack JavaScript Techdegree Graduate 27,918 PointsThis is a method used commonly in jQuery, but as far as I know it's not native to vanilla JavaScript. My guess is this course was recorded back when using jQuery was more common. The latest release of JavaScript, ES6, has kind of made jQuery obsolete so it's not as common to see it anymore.