title: jQuery and coffee objects
body: <p>I'm trying to build a js object that represents a combination of HTML components. In the constructor of this object, the id of <code>div</code> element should be given as a parameter. My question is why I'm not able to use jQuery methods on when the given string is used as a jQuery selector and selected element is saved as a field of this object.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Element
    constructor: (id) -&gt;
      @form = $(id)
  
    addNewClass: (text) -&gt;
      @form.addClass(text)
    
  element = new Element '#element'
  element.addNewClass 'the_class'</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id='element'&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>P.S: I'm working on ruby on rails environment if this matters</p>