Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>$()</code> method is not part of the JavaScript language. It is often defined in JavaScript frameworks such as <a href="http://jquery.com" rel="nofollow noreferrer">jQuery</a> and <a href="http://www.prototypejs.org/" rel="nofollow noreferrer">Prototype</a>, as a <a href="http://en.wikipedia.org/wiki/Document_Object_Model" rel="nofollow noreferrer">DOM</a> selector.</p> <p>It is interesting to note that up to until December 2009, the <a href="http://en.wikipedia.org/wiki/ECMAScript" rel="nofollow noreferrer">ECMAScript</a> specification used to state:</p> <blockquote> <p>The dollar sign ($) and the underscore (_) are permitted anywhere in an identifier. <strong>The dollar sign is intended for use only in mechanically generated code.</strong> (<a href="https://stackoverflow.com/questions/205853/why-would-a-javascript-variable-start-with-a-dollar-sign/205974#205974">Source</a>)</p> </blockquote> <p>However this "<em>dollar sign for mechanically generated code</em>" hint was removed from the <a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf" rel="nofollow noreferrer">current ECMAScript specification</a> (ECMA 262 - 5th Edition / December 2009).</p> <hr> <p>Nevertheless, the original question was probably referring to the popular DOM selectors in jQuery, Prototype, et al. Here are a few jQuery examples:</p> <pre><code>$('*'); /* This selector is a wild card method and will select all elements in a document. */ $('#id'); /* This selector selects an element with the given ID. */ $('.class'); /* The class selector will gather all elements in the document with the given class name. */ $('element'); /* This selector will collect all elements in a document with the given tag name i.e. table, ul, li, a etc. */ </code></pre> <p>You may want to check the following article for more examples:</p> <ul> <li><a href="http://www.pamaya.com/jquery-selectors-and-attribute-selectors-reference-and-examples/" rel="nofollow noreferrer">jQuery selectors and examples</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload