I recoginzed that i can use $('span') even when no js-framework is loaded.

It works in FF, Chrome and Edge. Where does this function come from? I had never read about it. Is it a HTML5 feature?

up vote 3 down vote accepted

It's an alias for document.querySelector() provided by browser's developer tools. This shorthand is not available for page's JS code.

There are more useful dollar-tools, most notably $0 which contains a reference to DOM element selected in inspector.

Documentation:

  • Thanks, i had never heared about it – wutzebaer Dec 7 at 8:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.