Rajeev Prajapati
Which sign does jQuery use as a shortcut for jQuery?
By Rajeev Prajapati in JQuery on May 31 2013
  • Satish
    Jun, 2014 12

    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.

    • 1
  • Sahil Maheshwary
    Nov, 2013 20

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

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS