+ 1
Please someone explain what does $ sign meaning in js ?
I have seen $ sign in many places but cannot understand , would be grateful if someone explains , thankyou.
3 Answers
+ 2
a js variable name could start with either a letter, an underscore or a dollar sign...
the well known jQuery library use it alone to short reference its main object function, wich its basic purpose is to select an element in the dom.
that's why even without using jQuery a lot of js coders use it as a prefix to any variable holding a dom element ^^
however, it could mean anything and be used as variable name or part of variable name wich hold anything else ;P
(coders coming from Php should use it as required variable name prefix, so they could also keep this habit from there...)
+ 1
0
It is used to reference a jQuery function type or library .You know that jQuery is a JavaScript library?