+ 1

What is $?

In codes I always see a $, and I must have missed something because I've no idea why they're needed. When I delete them all, there are so many errors, so clearly there is a purpose. I would greatly appreciate an example where they are needed :)

25th Sep 2017, 12:51 AM
koala šŸØ
koala šŸØ - avatar
5 Answers
+ 3
By default, jQuery uses "
quot; as a shortcut for "jQuery" (From the jquery documentation). It tells the code to access the Jquery library and its methods. jQuery(document).ready(function(){}) is the same as $(document).ready(function(){})
25th Sep 2017, 1:05 AM
Patricio Salazar
Patricio Salazar - avatar
+ 1
@Patricio Salazar so you need to understand jQuery to know how to use it?
25th Sep 2017, 1:06 AM
koala šŸØ
koala šŸØ - avatar
+ 1
You will need to import a jQuery library to make the $ signs work. A $ sign in front of the method means it is a jQuery method.
25th Sep 2017, 1:07 AM
Khun Ling Tan
Khun Ling Tan - avatar
+ 1
well if you are using the jquery library the $ sign is just an indicator that the following in a jquery method.... is part of its syntax...
25th Sep 2017, 2:21 AM
Patricio Salazar
Patricio Salazar - avatar