title: Cakephp with Ajax, this.element.setAttribute is not a function
body: <p>I'm trying to make a stackoverflow like tags system.
  I followed this tutorial (in French): <a href="http://www.formation-cakephp.com/34/autocomplete-en-ajax" rel="nofollow noreferrer">http://www.formation-cakephp.com/34/autocomplete-en-ajax</a> which uses Prototype and Scriptaculous. Of course, I adapted it to my project</p>
  <p>I get the following error:</p>
  <pre><code>this.element.setAttribute is not a function : controls.js Line 86
  </code></pre>
  <p>which corresponds to</p>
  <pre><code>this.element.setAttribute('autocomplete','off');
  </code></pre>
  <p>in the control.js file</p>
  <p>I'm really new to Ajax, so I don't have a clue on what I'm doing (wrong)...</p>
  <p>If you need some code from any file, let me know!</p>
  <p>view.ctp:</p>
  <pre><code>&lt;div class=&quot;input&quot;&gt;
  &lt;label&gt;Tags :&lt;/label&gt;
  &lt;?php e($ajax-&gt;autoComplete(
      'Tag.tag',
      '/tags/autocomplete',
      array(
          'minChars' =&gt; 3,
          'indicator' =&gt; 'ajaxloader'
      )
  )); ?&gt; 
  &lt;div id=&quot;ajaxloader&quot; style=&quot;display:none;&quot;&gt;
      Chargement...
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller:</p>
  <pre><code>function autocomplete()
  {
      $recherche = utf8_decode($this-&gt;data['Tag']['tag']);
  
      $tags = $this-&gt;Tag-&gt;find(
          'all',
          array(
              'fields' =&gt; 'DISTINCT tag',
              'conditions' =&gt; &quot;tag LIKE '$recherche%'&quot;,
              'order' =&gt; 'tag',
              'limit' =&gt; 10
          )
      );
  
      $this-&gt;set(compact('tag', 'recherche'));
  }
  </code></pre>