Possible Duplicate:
What is the meaning of “$” sign in JavaScript
Why do we use the dollar ($) symbol in jQuery and JavaScript?
I always put a dollar in my scripts but I actuary don’t know why.
For an example:
$('#Text').click(function () {
$('#Text').css('color', 'red')
});
This just changes the text colour when you click it, but it demonstrates my point.
In JavaScript it has no special significance (no more than
aorQanyway). It is just an uninformative variable name.In jQuery the variable is assigned a copy of the
jQueryfunction. This function is heavily overloaded and means half a dozen different things depending on what arguments it is passed. In this particular example you are passing it a string that contains a selector, so the function means “Create a jQuery object containing the element with the id Text“.