title: How to add an id or a class to a form element in Drupal?
body: <p>What I'm trying to do is add an id to a hidden field, so that I can edit its value via JS. For example, I want to give the hidden element I create via a Drupal form with this:</p>
  
  <pre><code>$form['position'] = array(
  '#type' =&gt; 'hidden',
  '#default_value' =&gt; '57.149953,-2.104053',
  );
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>&lt;input type="hidden" name="position" value="57.149953,-2.104053" /&gt;
  </code></pre>
  
  <p>Well I would like to add an id, a name and a class to that input. What's the best way to go around doing this?</p>
  
  <p>Thanks</p>