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
moath alqutoob
2,450 Pointswhy he put $
why he put $ like php
3 Answers
Francis Isberto
Courses Plus Student 25,343 PointsHere are a few tips Moath Alqutoob,
All selectors in jQuery start with the dollar sign and parentheses: $().
In jQuery, the $ sign it's just an alias to jQuery(), then an alias to a function.
Here are some samples:
Basic syntax is: $(selector).action()
A dollar sign to define jQuery A (selector) to "query (or find)" HTML elements A jQuery action() to be performed on the element(s)
My advice.... get to know Javascript first. Then once you get to know the basics then you can jump into the dollar sign $ (jQuery). And believe me, you will love all the "shortcuts" techniques of jQuery.
Have fun!
Francis
Clinton Hopgood
7,825 PointsHow did the $ sign get used? In JavaScript you can also use dollar signs in variables.
Ian Kersey
9,318 PointsIf you're using jQuery, the $ can be used as an alias for jQuery. I suggest checking out the documentation here: http://api.jquery.com/jQuery.noConflict/