2
Reply

Which sign does jQuery use as a shortcut for jQuery?

Rajeev Prajapati

Rajeev Prajapati

11y
2.2k
0
Reply

    The standard shortcut for the jQuery function provided by the jQuery library is $ For instance: $('p').css('color','red'); It Would select every paragraph on the page, and change it's font color to red. This line is exactly the same as: jQuery('p').css('color','red'); Often the $ is used by other libraries, so it may be turned off in jQuery in "noConfilct" mode.There's nothing mysterious about the use of "$" in JavaScript. $ is simply a valid JavaScript identifier.JavaScript allows upper and lower letters, numbers, and $ and _. The $ was intended to be used for machine-generated variables (such as $0001).Prototype, jQuery, and most javascript libraries use the $ as the primary base object (or function). Most of them also have a way to relinquish the $ so that it can be used with another library that uses it. In that case you use "jQuery" instead of "$". In fact, "$" is just a shortcut for "jQuery".So, using $("#id") or jQuery("#id") is the same.

    You can use $ or Jquery signs. You can also define your own signs.