Comment on Custom Colors of HNparentComments−hamxiaoz12yWhat does the $$ mean?−thedufer12yLooking at it in the console, it looks like $ returns a single DOM element and $$ returns a NodeList (array-like object) of DOM elements. Not sure what library that is.−reubenmorais12yNo library, at least in Firefox it's defined by devtools and only works in the console (provided the page doesn't have it's own $ and $$ globals).[0] http://dxr.mozilla.org/mozilla-central/source/toolkit/devtoo...[1] http://dxr.mozilla.org/mozilla-central/source/toolkit/devtoo...Edit: It works in the WebKit devtools too:[0] https://mxr.mozilla.org/chromium/source/src/third_party/WebK...−scrabble12yPrototypeJS works that way.−dmnd12yIt's shorthand for document.querySelectorAll: https://developers.google.com/chrome-developer-tools/docs/co...
Comments
What does the $$ mean?
Looking at it in the console, it looks like $ returns a single DOM element and $$ returns a NodeList (array-like object) of DOM elements. Not sure what library that is.
No library, at least in Firefox it's defined by devtools and only works in the console (provided the page doesn't have it's own $ and $$ globals).
[0] http://dxr.mozilla.org/mozilla-central/source/toolkit/devtoo...
[1] http://dxr.mozilla.org/mozilla-central/source/toolkit/devtoo...
Edit: It works in the WebKit devtools too:
[0] https://mxr.mozilla.org/chromium/source/src/third_party/WebK...
PrototypeJS works that way.
It's shorthand for document.querySelectorAll: https://developers.google.com/chrome-developer-tools/docs/co...