What is the difference between $ and $$?

前端 未结 7 1069
执笔经年
执笔经年 2020-12-15 09:19

I have been going through some jQuery functionality.

Can any one please give me some idea of what the difference is between the use of $ and $$

7条回答
  •  误落风尘
    2020-12-15 09:56

    jQuery is an object provided by jQuery. $ is another, which is just an alias to jQuery.

    $$ is not provided by jQuery. It's provided by other libraries, such as Mootools or Prototype.js.

    More importantly, $$ is also provided in the console of modern browsers as an alias to document.querySelectorAll. Except if it's overridden by another library. $ is also provided in the same way, as an alias to document.querySelector.

    See this answer for more information.

提交回复
热议问题