Possible Duplicate:
What is the meaning of “$” sign in javascript
I've encountered a code in JavaScript that looks like this:
$('svg circle').tipsy({
gravity: 'w',
html: true,
title: function() {
return 'Color: ';
}
});
What does $('') mean here?
Usually when you encounter $(), that means the developer is using a javascript library, such as jQuery.
The $ symbol is the namespace for those libraries. All the functions they define begin with $., such as $.get(). Passing the id of an html tag like this: $("#myId") will give you a jQuery object representing that node.
This is from using the jQuery library, which is used to standardize JavaScript usage between browsers and make accessing elements and other common tasks much, much easier. It is not a part of JavaScript itself, except insofar as $ is an acceptable name for a function or variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With